我已经在xcode框架中为iPad上的SAP做了申请。使用web视图方法,我可以在iPad中打开我的应用程序网页。html5页面存储在我的pc上。我的问题是如何通过html5网页使用SAP SOAP web服务。我应该先做哪些步骤?我有访问SAP的ES工作场所。我没有任何想法,因为这是我的第一个项目。有人可以给我提供适当的视频教程或具体的链接来阅读。大多数链接都是针对REST风格的web服务的。提前谢谢。我的web服务url是"http://erp.esworkplace.sap.com/sap/bc/srt/wsdl/bndg_DF5300E043F279F18F0400145E5ADE89/wsdl11/allinone/ws_policy/document?sap-client=800“,它以wsdl格式打开。和"MaterialBasicDataByIDQueryResponse_In“这是我的函数名
发布于 2011-04-27 19:34:35
我强烈推荐REST!它的重量轻多了
在本例中,我在您的html页面中使用了jQuery
<script id="soap-template" type="application/soap-template"> <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns0:getSOAP xmlns:ns0="http://localhost:8080/soap"> <search>${id}</search></ns0:getSOAP ></soap:Body></soap:Envelope></script>JS:
var soapBody = $("#soap-template").html().replace(
new RegExp( "\\$\\{[^}]+\\}", "i" ),
search
);
soapBody = $.trim( soapBody );
$.ajax({
type: "post",
url: "http://localhost:8080/soap",
contentType: "text/xml",
data: soapBody,
dataType: "xml",
processData: false,
beforeSend: function( xhr ){
// Pass the target URL onto the proxy.
xhr.setRequestHeader(
"SOAPTarget",
"http://localhost:8080/soap"
);
// Pass the action onto the proxy.
xhr.setRequestHeader(
"SOAPAction",
"http://localhost:8080/soap/getSOAP"
);
},
success: function( response ){
// Get a jQuery-ized version of the response.
var xml = $( response );
//handle your result
},
error: function(){
alert("error");
console.log( "ERROR", arguments );
}
});https://stackoverflow.com/questions/5754463
复制相似问题