我已經在javascript中創建了一個SOAP客戶端。問題是它只適用於Google Chrome。SOAP客戶端只能在谷歌瀏覽器中使用
代碼:
$("#send").click(function (event) {
var wsUrl = "http://myip:8084/Service1.asmx";
var soapRequest =
'<?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:Body> \
<GetVozilo xmlns="http://mydomain.com/apps"> \
<vin>' + $("#vin").val() + '</vin> \
</GetVozilo> \
</soap:Body> \
</soap:Envelope>';
console.log(soapRequest);
$.ajax({
type: "post",
url: wsUrl,
contentType: "text/xml",
dataType: "xml",
data: soapRequest,
success: processSuccess,
error: processError
});
});
在控制檯我也收到此錯誤:
OPTIONS http://mydomain.com/Service1.asmx 403 (Forbidden)
你能幫幫我嗎?