私はWCF service
にPOSTリクエストを作成しようとしているように、私は私がPORT 8181
jQuery.POST:呼び出されていないWCFサービスを呼び出す!
WCFサービスメソッドでWebHttpBindingと私のWCF service is hosted in Windows service
を使用していPOST the service request
とcan't get response.
にできることではないのです。
[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
私は答えはありませんが、これはWCF用のRESTキットを使用していますか? – Mayo
あなたのサービスURLのクエリ文字列が、構築されたjquery呼び出しで見つからないという誤植ですか? –