If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Help to call one method from web service

Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: Help to call one method from web service

Hey ravi,

 

Not sure if this is for a BB app or not? But this code should get you on your way. It's important that you understand the data you are trying to get from the WSDL. More information can be seen here:

 

http://www.w3.org/TR/wsdl

 

function onError(requestdatastatus{
    console.log(status);
}

function onSuccess(datastatus{
    console.log(data);
}

function loadData({

    var soapMessage '<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope xmlns:smileyfrustrated:OAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://wsendpoints.bbrailapps.firstgroup.com" xmlns:intf="http://wsendpoints.bbrailapps.firstgroup.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><SOAP-ENV:Body><intf:getVersion xmlns:intf="http://wsendpoints.bbrailapps.firstgroup.com"></intf:getVersion></SOAP-ENV:Body></SOAP-ENV:Envelope>';

    $.ajax({
        url"http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl",
        type"POST",
        dataType"xml",
        datasoapMessage,
        processDatafalse,
        contentType"text/xml; charset=\"utf-8\"",
        successonSuccess,
        erroronError
    });
}

loadData();

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help to call one method from web service

Thanks

Sir for reply

 

actually i am getting all xml .

 

But expected result should be after call get version : 1.3

 

can you help me getting this

 

Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help to call one method from web service

After calling getversion method 

Expected result should be : 1.3 or 1.4

Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: Help to call one method from web service

The expected result from a SOAP webservice is always XML. This is the output I get below:

 

<script/>
<soapenv:Body>
<getVersionResponse xmlns="http://wsendpoints.bbrailapps.firstgroup.com">
<getVersionReturn>1.3</getVersionReturn>
</getVersionResponse>
</soapenv:Body>
</soapenv:Envelope>
@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help to call one method from web service

<!DOCTYPE html> 
<html> 
    <head> 
        <meta charset="utf-8"> 
        <title>Hello World</title> 
  <script src="jquery.min.js" type="text/javascript"></script> 
  	<script>
function onError(request, data, status) {
    console.log(status);
}

function onSuccess(data, status) {
    console.log(data);
}

function loadData() {

    var soapMessage = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope xmlnsOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://wsendpoints.bbrailapps.firstgroup.com" xmlns:intf="http://wsendpoints.bbrailapps.firstgroup.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><SOAP-ENV:Body><intf:getVersion xmlns:intf="http://wsendpoints.bbrailapps.firstgroup.com"></intf:getVersion></SOAP-ENV:Body></SOAP-ENV:Envelope>';

    $.ajax({
        url: "http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl",
        type: "POST",
        dataType: "xml",
        data: soapMessage,
        processData: false,
        contentType: "text/xml; charset=\"utf-8\"",
        success: onSuccess,
        error: onError
    });
}
		
		</script>
 
    </head> 
    <body onload="loadData();"></body> 
</html>

 i used this code and getting error

 

  1. POST http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl 500 (Internal Server Error) jquery.min.js:4
    1. f.support.ajax.f.ajaxTransport.sendjquery.min.js:4
    2. f.extend.ajaxjquery.min.js:4
    3. loadDatatest.html:20
    4. onload

 

    1.  
       
      But when i change type: "GET", i get whole xml .having none of value..:smileysad:
       
       

 

Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help to call one method from web service

Your output is correct but i am not get this out put please help

Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help to call one method from web service

Error display internal server error..

Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help to call one method from web service

Please help , to solve this issue

Please use plain text.