09-10-2012 03:24 AM
Hi
isServiceAlertPresent=unescape(params["isServiceAl
isOtherAlertPresent=unescape(params["isOtherAlertP
alertSummary= unescape(params["alertSummary"]);// fasle
alert(isServiceAlertPresent);// false display
alert(isOtherAlertPresent);// false display
if((isOtherAlertPresent)||(isServiceAlertPresent))
alert("Yes"); // why it display yes..??
document.getElementById('alertIcon').style.visibil
}
else{
alert("NO");
document.getElementById('alertIcon').style.visibil
}
09-17-2012 11:54 AM
09-17-2012 12:02 PM
Done it..please help me to call soap based web service..
09-17-2012 12:09 PM
Hi There,
Here is an article which explains how to use webservice with in a web works applicaiton. It has sample code as well.
Thanks
Naveen M
09-17-2012 12:16 PM
Hi
i want to call soap based web service i got simple way to call web service from this url..
http://stackoverflow.com/questions/124269/simplest
But i don't understand where to add method name so that it call that method from service, in web service there are some method which i want to call but unable to call
can you please help me..
<html>
<head>
<title>SOAP JavaScript Client Test</title>
<script type="text/javascript">
function soap() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', 'https://somesoapurl.com/', true);
// build SOAP request
var sr =
'<?xml version="1.0" encoding="utf-8"?>' +
'<soapenv:Envelope ' +
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
'xmlns:api="http://127.0.0.1/Integrics/Enswitch/API" ' +
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">' +
'<soapenv:Body>' +
'<api:some_api_call soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
'<username xsi:type="xsd:string">login_username</username>' +
'<password xsi:type="xsd:string">password</password>' +
'</api:some_api_call>' +
'</soapenv:Body>' +
'</soapenv:Envelope>';
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
alert('done use firebug to see responce');
}
}
}
// Send the POST request
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.send(sr);
// send request
// ...
}
</script>
</head>
<body>
<form name="Demo" action="" method="post">
<div>
<input type="button" value="Soap" onclick="soap();" />
</div>
</form>
</body>
<html>where to add methods..?
09-17-2012 03:24 PM
Hi there,
Does the web service you are using have any public documetnation? In order to call specific functionality of a web service, you would need to format your request based on their documentation. Essentially, this part:
var sr =
'<?xml version="1.0" encoding="utf-8"?>' +
'<soapenv:Envelope ' +
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
'xmlns:api="http://127.0.0.1/Integrics/Enswitch/API" ' +
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">' +
'<soapenv:Body>' +
'<api:some_api_call soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
'<username xsi:type="xsd:string">login_username</username>' +
'<password xsi:type="xsd:string">password</password>' +
'</api:some_api_call>' +
'</soapenv:Body>' +
'</soapenv:Envelope>';
Needs to have the correct structure and format as required by the web service, and that would invoke the appropriate web service function. Without knowing which web service you are using though, it is difficult to say what that structure needs to look like.
09-17-2012 06:13 PM - edited 09-17-2012 06:13 PM
I think the problem is that the web service is SOAP. Creating a mobile app which runs on the phone will be classed as cross domain scripting.
Here is his original thread and url for web service:
The url that may help is this one:
http://184.106.159.143:8080/FirstGroupRailApps/ser
09-17-2012 06:41 PM
In theory this should work (returning the version) BUT it takes you to the login page, maybe someone else could better the code...
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="jquery.min.js"></script> <script> var productServiceUrl = 'http://184.106.159.143:8080/FirstGroupRailApps/services/RailAppsCAWS/getVersion'; function beginProduct() { $.ajax({ url: productServiceUrl, type: "GET", contentType: "application/javascript", dataType: "jsonp", data: '{}', complete: endSaveProduct, }); return false; } function endSaveProduct(xmlHttpRequest, status) { $(xmlHttpRequest.responseXML) .find('SaveProductResult') .each(function() { var name = $(this).find('myDiv').text(); }); } </script> </head> <body> <div id="myDiv"><h2>Sample Code</h2></div> <button type="button" onclick="beginProduct()">Get Content</button> </body> </html>
09-17-2012 06:46 PM
wait sir i will check
09-17-2012 06:52 PM