Solved

Does anyone know how to pass a List<t> to a WCF Service

Posted on 2010-11-11
4
418 Views
Last Modified: 2012-06-21
I have a WCF service that accepts a List<participants> as a parameter and I need to call it from the client ie javascript.  Can this be compeleted?

I'm looking to do something like.
var svc = new EMService();
                var valParti = $('#ddlParticipant').val();
                var list = new List<Participant>();
                var part = new Participant();
                list.Add(part);
                svc.SendMessageAll(list, onSuccess, null, null);
0
Comment
Question by:zekuczynski
  • 2
4 Comments
 
LVL 7

Expert Comment

by:keustermans
ID: 34119295
Hi there,

As far as I know you are notable to pass generic objects through wcf.

0
 

Author Comment

by:zekuczynski
ID: 34120212
Is there another approach I can take?  Can I pass a collection or list of objects?
0
 
LVL 7

Accepted Solution

by:
dxdinh earned 500 total points
ID: 34127657
Can you try to convert your List<P...> collections to Participant [] using ToArray method?
0
 

Author Closing Comment

by:zekuczynski
ID: 34155579
That worked.  Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now