1
這是我的代碼:415不支持的媒體類型的jQuery
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!");
}
});
而且我得到了錯誤415(不支持的媒體類型)。我試圖計算幾個小時,但我不知道是什麼問題。請幫忙!