Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6711971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:12:17+00:00 2026-05-26T08:12:17+00:00

It is my first experience with .net, so the question can be simple. I

  • 0

It is my first experience with .net, so the question can be simple. I have the Web Method of Web Service:

[WebMethod(CacheDuration = 30,
            Description = "Returns an Array of Clients.")]
        public ClientData[] GetClientData(int Number)
        {
            ClientData[] Clients = null;

            if (Number > 0 && Number <= 10)
            {
                Clients = new ClientData[Number];
                for (int i = 0; i < Number; i++)
                {
                    Clients[i].Name = "Client " + i.ToString();
                    Clients[i].ID = i;
                }
            }

            return Clients;
        }

And I create the client for this Web Service:

   LocalService.Service1 service = new LocalService.Service1();
   String data = service.HelloWorld();
   ClientData[] clients = service.GetClientData(3);

I have declared the struct datetype in the Web Service and Web Client:

public struct ClientData
    {
        public String Name;
        public int ID;
    }

Now I get the error in the Cleint:

Error   1   Cannot convert type 'ConsoleApplication1.LocalService.ClientData[]' to 'ConsoleApplication1.ClientData[]'   C:\Users\ademidov\documents\visual studio 2010\Projects\WebService1\ConsoleApplication1\Program.cs  22  36  ConsoleApplication1

How can I fix it ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:12:18+00:00Added an answer on May 26, 2026 at 8:12 am

    Try this:

    LocalService.ClientData[] clients = service.GetClientData(3);
    

    What might be happening is that you may have declared ClientData again in your own code but this is not the definition that is being returned by the service. So you need to get the data in the same datatype which was used by the service. Hence we have used the LocalService.ClientData class.

    This simply means that we want to use the ClientData class in the LocalService namespace which contains details about the service objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some experience writing web applications in Java for class projects. My first
I'm just starting my first project in ASP.NET MVC. In my webforms experience, I
First off I should say that I don't have any experience in working with
I have a general question about inheritance in the .NET framework, lets say you
I'm looking for feedback from .Net developers who have experience with Aldon as a
My setup: ASP.NET 4.0 Web Site running on IIS 6.0. I have a site
I have 2 1/2 years experience of VB.Net, mostly self taught, so please bear
Hey everyone.. This is my first time writing an ASP.NET MVC web app, and
I have been playing with jstree (1.0rc2)+jquery (1.4.2) for the first time with c#.net
I have about 4-6 years .NET experience. Primarly using ASP.NET MVC/Nhibernate/Castle Windsor/MSpec/etc in visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.