2

こんにちは、WCF Web サービス (.svc) を呼び出そうとしています。

$.ajax({
    url: 'http://www.somedoamin.com/Services/service.svc',
    dataType: "text/xml",
    contentType:'text/xml; charset=utf-8',
    beforeSend: function(xhr){
        // Pass the soap action onto the proxy.
        xhr.setRequestHeader(
            "SOAPAction","http://www.anotherdomain.com/Services/Login"
        );
    },   
    data:soapMessage,
    type: 'POST',
    success: function(res) {
            var myXML = res.responseText;
    console.log('Response ',myXML);  
    },
    error:function(jqXHR, textStatus, errorThrown,exception) {
        console.log('An error occured ');
    }
}); 

エラー コールバックが発生しています。"エラーが発生した"

それで、いくつかのパラメーターを WCF Service に追加する必要がありますか?

4

1 に答える 1

0

この既存の参照jQueryからWCFWebサービスを呼び出すにはどうすればよいですか?

これは、彼らがhttp://www.west-wind.com/weblog/posts/2008/Apr/21/jQuery-AJAX-calls-to-a-WCF-REST-Serviceに提供したソリューションです 。

于 2012-09-20T06:17:30.283 に答える