我想打电话SOAP网络服务在Phonegap(Android)
我已经尝试过这段代码但是在回复文字有未定义和Status Error
<!DOCTYPE>
<html>
<head>
<title>SOAP JavaScript Client Test</title>
<script type="text/javascript" src="../cordova.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
function soap() {
$.ajax({
type: "POST",
url: "http://domain_Url/orabpel/default/XXNotificationListRetrieval/1.0",
dataType: "xml",
contentType: 'text/xml; charset=utf-8',
data: '<soap:Envelope'+
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'+
'xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">'+
'<soap:Header>'+
'<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" soap:mustUnderstand="1">'+
'<wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">'+
'<wsse:Username>Hello</wsse:Username>'+
'<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">world</wsse:Password></wsse:UsernameToken></wsse:Security>'+
'</soap:Header>'+
'<soap:Body '+
' xmlns:ns1="http://xmlns.oracle.com/bpel/mobile/Notificationlist">'+
'<ns1:NotificationlistRetrievalREQ>'+
'<ns1:NotificationlistType>OFFER</ns1:NotificationlistType>'+
'<ns1:Status>TODO</ns1:Status>'+
'<ns1:Mode/>'+
'</ns1:NotificationlistRetrievalREQ>'+
'</soap:Body>'+
'</soap:Envelope>';
success: processSuccess,
error: processError
});
function processSuccess(data, status, req) {
if (status == "success")
alert(req.responseText + " " + status);
}
function processError(data, status, req) {
alert(req.responseText + " " + status);
}
}
</script>
</head>
<body>
<form name="Demo" action="POST" method="post">
<div>
<input type="button" value="Soap" onclick="soap()" />
<div id="response" />
</div>
</form>
</body>
<html>
我访问了以下链接,但没有得到满意的答案。每个人都只是定义了不同的链接,但没有给出正确的想法,所以它无法理解,因为我是 Phonegap 的新手。
如何在PhoneGap(Android)中调用Soap Web服务 https://stackoverflow.com/questions/12346752/how-to-call-soap-web-services-in-phonegapandroid
如何在 Android 中使用 PhoneGap 和 jquery 调用基于 SOAP 的 Web 服务? https://groups.google.com/forum/#!topic/phonegap/MDKGlErSD2s
如何在PhoneGap中调用android Soap Web服务(Android) https://stackoverflow.com/questions/12650123/how-to-call-android-soap-web-services-in-phonegapandroid
如果我得到示例代码那么它将是可观的,我正在使用 Cordova.js 2.9.0