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). 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 = "<soapenv
, but never close this quote. Same line is xmlns:soapenv=\\"http
, another quote you don't close. But ultimately, I'd suggest using a third-party SOAP library for jQuery, rather than trying to roll your own envelope.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.