我需要將數據發佈到我的後端系統(SAP)。我嘗試使用下面的代碼:jQuery.Ajax發佈到webservice
硬編碼的URL例如:
var dataString = ""
//Add TO SAP.
var aData =
jQuery.ajax({
type: "POST",
//contentType: "application/xml",
url: "http://delyo001.you.local:8000/sap/bc/youconsulting/ws/rest/anonymous/z_names_post?firstname=testz&lastname=zefzef", // for different servers cross-domain restrictions need to be handled
data: dataString,
//dataType: "json"
success: function(xml) { // callback called when data is received
//oModel.setData(data); // fill the received data into the JSONModel
alert("success to post");
},
error: function(xml) { // callback called when data is received
//oModel.setData(data); // fill the received data into the JSONModel
alert("fail to post");
alert(xml);
}
});
的Web服務通過SOAPUI工作。但不是通過這種方式。
任何人都可以請指導這個代碼有什麼問題。
親切的問候, 文森特
您是否收到任何錯誤? –
是的警報無法發佈後觸發,問題是它在soapui中正常工作。我無法獲得任何特定的錯誤消息。 – Vinozio