Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-11-11
4
Medium Priority
?
427 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

876 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