当我试图向我的 POST 请求时WCF service
,我无法POST the service request
并且can't get response.
我正在使用WebHttpBinding和我WCF service is hosted in Windows service
的 withPORT 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);
}
});
谁能告诉我为什么我无法调用此服务以及如何解决此问题?
提前致谢!