you can send this as JSON objects through javascript/jquery and at the Service class code behind you can parse these objects using newtonsoft.dll or you have .net Collections their to make these objects available, if you willing to use newtonsoft.dll
you have documents in the site to play around
thanks
chandru
i'm not prepare to survive,but preparing to defeat
dotnet_CH
Member
40 Points
260 Posts
how to send JS object to wcf service via ajax call
Nov 22, 2012 04:09 PM|LINK
i have js object with properties like
firstname
lastname
address
email
phone
i want to send this object of js to wcf serice method in parameter. now i plan to have some kind of csharp class with same set of
properties and want to use in parameter of the wcf service method.
is this will work, object of js will be send via ajax call to wcf where we have some kind of object in csharp class.
now question is this will work or there is some better idea to achieve this.
Chetan Chopa...
Participant
1980 Points
347 Posts
Re: how to send JS object to wcf service via ajax call
Nov 22, 2012 04:33 PM|LINK
You can achieve this using webmethod in your code behind file and can call that webmethod through ajax.
In this webmethod you can write the logic to consume and pass the object to wcf service
Chetan Chopa...
Participant
1980 Points
347 Posts
Re: how to send JS object to wcf service via ajax call
Nov 22, 2012 04:35 PM|LINK
Below links will help yo to achieve this:
http://encosia.com/using-complex-types-to-make-calling-services-less-complex/
http://pavanarya.wordpress.com/2012/09/09/calling-a-webservice-using-jquery-and-passing-jsonarray-object/
asteranup
All-Star
30184 Points
4906 Posts
Re: how to send JS object to wcf service via ajax call
Nov 23, 2012 02:01 AM|LINK
Hi,
You can check few posts here-
http://delicious.com/anupdg/wcf+jquery+ajax
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
chandruvelan
Member
126 Points
38 Posts
Re: how to send JS object to wcf service via ajax call
Nov 26, 2012 07:04 AM|LINK
hi dotnet_CH,
you can send this as JSON objects through javascript/jquery and at the Service class code behind you can parse these objects using newtonsoft.dll or you have .net Collections their to make these objects available, if you willing to use newtonsoft.dll you have documents in the site to play around
thanks
chandru