我用 javascript 制作了一个 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
});
});
在控制台中,我也收到此错误:
选项http://mydomain.com/Service1.asmx 403(禁止)
你能帮我么?