jQueryAjaxを使用してasmxサービスを呼び出そうとしています。
POST /YderWS.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://scandihealth.com/iwebservices/HentKommuner"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<AuthHeader xmlns="http://scandihealth.com/iwebservices/">
<PartnerID>string</PartnerID>
<SubPartnerID>string</SubPartnerID>
<SubPartnerType>string</SubPartnerType>
</AuthHeader>
</soap:Header>
<soap:Body>
<HentKommuner xmlns="http://scandihealth.com/iwebservices/" />
</soap:Body>
</soap:Envelope>
上記は、サービスに送信する必要のあるSOAP1.1リクエストです。以下の呼び出しを使用して、カスタムの石鹸ヘッダーを設定しています。しかし、私の要求は失敗します。誰かが私のために以下のコードをデバッグして、私が何をする必要があるかを私に知らせてもらえますか?
var authHeader = "<PartnerID>SCTEST001</PartnerID> <SubPartnerID>001</SubPartnerID> <SubPartnerType>S</SubPartnerType>";
//Call the page method
$.ajax({
type: "GET",
url: servicename + "/" + functionName,
beforeSend: function (xhr) {
xhr.setRequestHeader('AuthHeader', authHeader);
},
success: successFn,
error: errorFn
});
編集*この質問に答えるために追加情報が必要な場合はお知らせください。*