我正在尝试使用 Javascript 发出 SOAP 请求,但它似乎不起作用。请在下面找到已使用的代码。
URL="http://footballpool.dataaccess.eu/data/info.wso";
xmlStr="<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><AllDefenders xmlns="http://footballpool.dataaccess.eu"> <sCountryName>string</sCountryName></AllDefenders></soap:Body></soap:Envelope>";
jQuery.ajax({
type: "POST",
url: URL,
dataType: "xml",
processData: false,
data: xmlStr,
beforeSend: function(req) {
req.setRequestHeader("Method", "POST");
req.setRequestHeader("Content-Type", "text/xml" + "; charset=\"" + "UTF-8" + "\"");
}
});
回复:
Object
OPTIONS http://footballpool.dataaccess.eu/data/info.wso 400 (Bad Request)
jquery.js:4 XMLHttpRequest cannot load http://footballpool.dataaccess.eu/data/info.wso. Origin http://www.know7.com is not allowed by Access-Control-Allow-Origin.
我正在尝试从http://footballpool.dataaccess.eu/data/info.wso?op=AllDefenders获得响应
谢谢..