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

  • SEARCH
  • Home
  • 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 7867031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:35:52+00:00 2026-06-03T00:35:52+00:00

In my WCF service contract I have declared an asyn method that return a

  • 0

In my WCF service contract I have declared an asyn method that return a List, but when in my client I receive the return from the method, I receive an array. My contract is the following:

[OperationContract(AsyncPattern = true)]
IAsyncResult BeginGetUsers(Paramusers paramUserParameters, AsyncCallback callback, object state);
List<Users> EndGetUsers(IAsyncResult result);

In my client I have the following code:

Task<List<Users>> task = Task<List<Users>>.Factory.FromAsync(_proxy.Proxy.BeginGetUsers, _proxy.Proxy.EndGetUsers, myParameters,  null);
List<Users> myUsers = await task;

In the client, I receive an error in the second parameter of FromAsync method, because it says that the EndGetUsers method returns an array, not a list.

I try to use an array of users and works fine, but I would like to receive the list from the async method, not an array. is it possible?

Thanks.
Daimroc.

  • 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-06-03T00:35:55+00:00Added an answer on June 3, 2026 at 12:35 am

    When you create your client proxy, specify that you want collections to be represented as lists instead of arrays – when using the “Add Service Reference” dialog, choose the “Advanced” button, then select System.Collections.Generic.List in the collection type drop-down list.

    If you use svcutil, you can use the /collectionType (or /ct) parameter to specify the type of collections to use:

    svcutil http://the.service.com/service.svc /ct:System.Collections.Generic.List`1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basicHttpBinding WCF service. Via the contract I expose a method that
I have a WCF service implemented with a call back contract that I am
I have a WCF service that uses Message contract for request and replies of
I have a simple REST web service in WCF that is declared as follows:
I currently have a wcf service library project that includes my service contract &
I have a simple wcf Service Contract that works fine if I use the
I have a wcf sevice and silverlight client. My contract has callbacks and therefore
I have a wcf service. The service itself (class that inherits the ServiceContract )
I have a versioning issue with a WCF service contract in which one of
I have a WCF service (.NET 4) hosted in IIS. My service contract has

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.