c# - Sent JSON parameter is null in WCF Service method -
I want to update a list of confirmations from a server and I use AJAX using jQuery.
The problem is that I send data (seen in Fidel's) but the service does not get that list.
The parameters of the web method are a string and a list, the token is OK, but the list is empty
Ajax call:.
$ ajax ({url :. "http: // localhost: 8000 / teamplay / externalclientrestservice.? SVC / UpdateConfirmationListforAttender accessToken =" + accessToken, type: "POST", contentType: " application / json ", datatype:" json ", processData: false, data: '{" accessToken ":' + JSON.stringify (accessToken) + '," list ":' + JSON.stringify (confirmationList) + '}' }) to (function (ReceivedList) {alert ( "a ?? nderungen wurden erfolgreich übernommen"); return receivedList;}) failed (.. function () {alert ( "Attvis It Caf Gegangen. span spotters Irnet Warchesn.") ;}); WebMethod:
[OperationContract] [WebInvoke (method = "post", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = " Update Confirmation List for the Administrator? Existine = {AccessToken} ")] List & Placement Modify List Items & gt; Update Confirmation List for Attender (String AccessToken, List & quot; AppointmentSearchListItem & gt; List); In Fiddler I see the list, encrypted and accessed from JSON
What am I doing?
Thanks in advance!
I'm a newbie to Jason, but I have a similar problem.
I am looking at it from the server side, (REST WCF).
I have found that the "solution" was to add the name of the method at the beginning of your Jason String.
should be the case went recommended by my json string:
{ "UpdateConfirmationListforAttender": { "accessToken": '+ JSON.stringify (accessToken) +' "list": '+
JSON.stringify (confirmationList) +'}}
I still have a more "inject clearly the method name for the generic" solution Without searching I can get my WCF parameter mine client side.
Comments
Post a Comment