[英]415 Unsupported Media Type jQuery
This is my code : 这是我的代码:
var myGTP = {};
var urlGTP = "http://gtpmain.wdf.xxxx.com:1080/sap/bc/srt/rfc/qte/rfc_read_struc_nodes/001/qte_rfc_read_struc_nodes/binding";
var soapMsg = 'var body = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/>' +
'<soapenv:Header/> <soapenv:Body> <urn:_-qte_-rfcReadStrucNodes>' +
'<IvLanguage>E</IvLanguage>' +
'<IvStructureId>' + structureId + '</IvStructureId>' +
'</urn:_-qte_-rfcReadStrucNodes> </soapenv:Body></soapenv:Envelope>';
$.ajax({
url : urlGTP,
dataType : 'jsonp',
type : 'GET',
async : false,
data : soapMsg,
contentType : 'text/xml; charset=UTF-8',
username : "myuser",
passowrd : "mypassword",
success : function(data) {
myGTP = data;
console.log(data);
},
error : function() {
alert("Error!");
}
});
And I got the error 415 (Unsupported Media Type). 我得到了错误415(不支持的媒体类型)。 I tried to figure for a few hours but I don't know what is the problem.
我试了几个小时,但我不知道出了什么问题。 Please help!
请帮忙!
var body = "
in your SOAP message? var body = "
在SOAP消息中包含var body = "
? var body = "<soapenv
, but never close this quote. Same line is xmlns:soapenv=\\"http
, another quote you don't close. var body = "<soapenv
,但是永远不要关闭此引号。同一行是xmlns:soapenv=\\"http
,您不会关闭的另一引号。 But ultimately, I'd suggest using a third-party SOAP library for jQuery, rather than trying to roll your own envelope. 但最终,我建议为jQuery使用第三方SOAP库,而不要尝试自己动手做信封。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.