Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810

How to call soap based web service in phone gap

Hi

 

can you please tell me how to call soap based web service in phonegap.?

actually i have some methods  having parameter in web service want to call that those methods, can you please help me.

 

Thanks

 

BlackBerry Development Advisor
Posts: 624
Registered: ‎10-01-2009
My Device: Z10

Re: How to call soap based web service in phone gap

Hi there,

 

Did these examples not work?  http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Is-there-any-other-way-to-call-s...

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810

Re: How to call soap based web service in phone gap

NO sir ........

 

where i  write method name..?

Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810

Re: How to call soap based web service in phone gap

Hi

 

it doesn't help me because in my web service i want to call web method ..

 

http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl

 

example : getversion.

 

but where i write my web method please help

Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810

Re: How to call soap based web service in phone gap

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-soap-example-using-javascript[^]
 
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();
********here is my url ******but where is method name which i want to call
            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>

 

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,

Re: How to call soap based web service in phone gap

I suggest you learn how to build a SOAP request first. The methods will be in the message you send.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810

Re: How to call soap based web service in phone gap

can you please expain in detail..

 

actually i have this  url http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl

 

i have lot of method there.

 

example getversion :

response will be 1.3

 

can you please give me some help

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,

Re: How to call soap based web service in phone gap

[ Edited ]

This should give you an idea of what to look for:

http://wscep.sourceforge.net/createrequest.html

 

This will help you build the query:

http://www.soapclient.com/soapmsg.html

 

but this is not a WebWorks specific issue. You would have more luck asking in a forum dealing with SOAP queries.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810

Re: How to call soap based web service in phone gap

sorry sir i am not getting any thing....:smileysad:

 

actually i used this url  http://www.codeproject.com/Articles/12816/JavaScript-SOAP-Client for calling web service : but this  not debug in firebug error is coming wsdl is null so i want to to different way to call erb service.but i am getting response in IE . but for future i want to change code (interested to call webservice in different way so that i will debug in firebug)..