Solved

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

Posted on 2010-11-11
4
416 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

15 Experts available now in Live!

Get 1:1 Help Now