Webservices - JSON - JQUERY
Bonjour,
Je n'arrive pas a consommer mon webservice avec JQUERY, message d'erreur générique : textStatus = error
Voici le WS
Code:
1 2 3 4 5 6
| <WebMethod(True)> _
Public Function DeleteSuiviFormation(ByVal idSuiviFormation As String) As String
Dim jsSerializer As New System.Web.Script.Serialization.JavaScriptSerializer()
Return jsSerializer.Serialize(DeleteEntity(idSuiviFormation))
End Function |
Le JS :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| function WSDeleteSuiviFormation(suiviFormationToDelete){
$.ajax({ url: getBaseURL()+"/WS/WSsuiviFormation.asmx/DeleteSuiviFormation",
type: "POST",
//contentType: "application/json; charset=utf-8",
beforeSend: function(xhr) {
xhr.setRequestHeader("Content-type","application/json; charset=utf-8"); },
data:'{idSuiviFormationList:"'+suiviFormationToDelete +'"}',
dataType: "json",
processData: false,
error:function(XMLHttpRequest,textStatus,errorThrown) {ShowError(XMLHttpRequest,textStatus,errorThrown);}
});
} |
Le header :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| Request URL:http://localhost:3065/SuiviFormation/WS/WSsuiviFormation.asmx/DeleteSuiviFormation
Request Headers
Accept:application/json, text/javascript, */*; q=0.01
Content-Type:application/x-www-form-urlencoded, application/json; charset=UTF-8
Origin:http://localhost:3065
Referer:http://localhost:3065/SuiviFormation/Suivi.aspx
User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3
X-Requested-With:XMLHttpRequest
Request Payload
{idSuiviFormationList:"id"} |
J'ai mis un point d’arrêt dans le WS mais je ne passe mais pas dedans ...
Merci de m'aider.