当我试图让POST请求我WCF service
,我不能够POST the service request
和can't get response.
jQuery.POST:调用WCF服务不被调用!
我使用的WebHttpBinding我WCF service is hosted in Windows service
与PORT 8181
WCF服务方法:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "/{cstid}/{deptid}/get/customer/?cstname={cstname}",
BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
Customer CustomerGet(string cstid, string deptid, string cstname);
JQuery POST方法
jQuery.ajax({
type: 'POST',
url: 'http://localhost:8181/mysite/e48/91/get/customer/?',
dataType: 'json',
contentType: "application/json; charset=utf-8",
processData: false,
success: function (data) {
alert(data); // not getting anything :(
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert('Error :' + textStatus);
}
});
有没有人请让我知道我为什么不能调用这个服务,我该如何解决这个问题?
在此先感谢!
你用firebug使用firefox吗?是在控制台中显示的帖子?答案是什么样的? – Patricia
我没有答案,但是这是否使用REST套件用于WCF? – Mayo
是否在构造的jquery调用中缺少服务url的查询字符串? –