我有一个肥皂调用。当我打电话给我时,我得到了405错误。任何人都可以解决这个问题..这将是非常有益的,我很新的肥皂呼吁。 请你帮助我,不标记这个问题为重复的,我检查过..没有使用如何使用javascript或jquery进行soap调用。我在执行我的代码时遇到了405错误
POST /axis/services/G2A_PhoneMode HTTP/1.1
Content-Length: 609
User-Agent: Crosscheck Networks SOAPSonar
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns0="G2A_Sessions">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns0:logon>
<loginId xsi:type="xsd:string">[email protected]</loginId>
<password xsi:type="xsd:string">somePassword</password>
<version xsi:type="xsd:long">1</version>
</tns0:logon>
</soap:Body>
</soap:Envelope>
function logOnAgent() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', 'https://broker.gotoassist.com/axis/services/G2A_PhoneMode', true);
var xml_string = '<\?xml version="1.0" encoding="utf-8"?>'
+ '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns0="G2A_Sessions">'
+ '<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'
+ '<tns0:logon>'
+ '<loginId xsi:type="xsd:string">[email protected]</loginId>'
+ '<password xsi:type="xsd:string">myPassword</password>'
+ '<version xsi:type="xsd:long">1</version>'
+ '</tns0:logon>'
+ '</soap:Body>'
+ '</soap:Envelope>';
xmlhttp.setRequestHeader("Content-Type","text/xml");
xmlhttp.send(xml_string);
console.log(xmlhttp.responseText);
}
logOnAgent();
你没有得到你的问题的任何适当的答案吗?然后让我们知道。或者如果您有解决方案,请批准答案。 – bharatpatel