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

Re: why it goes to if condiation..?

is there any way to solve this problem ?

 

or i have to implement in differnt way..?:smileysad:

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

Re: why it goes to if condiation..?

can you so me favour ,

 

can you call one method of my web service using ajax or jquery as an example..

 

please so that i will debug the code..

 

 

Thanks

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: why it goes to if condiation..?

Setting up chrome
1. Click on start and search for chrome shortcut (assuming you have windows 7)
2. Right click and edit properties of chrome shortcut
3. In the box that says Target ... Start with quotes " and end with quotes ie: "C:\program files..."
4. On the end of the quotes add --disable-web-security
5. No quotes on --disable-web-security!
6. Say OK and save
7. Open chrome from this link for first time - do not use already open chrome.

8. Only use this newly edited link to open chrome in future

 

Setting up the web page
1. Create a new web page called index.html in a web folder

2. Make sure you have soapclient.js there too.

3. Insert code...

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
    <title>Ravi needs SOAP</title>
	<style type="text/css">
		div.h { display: none; }
		div.s { display: block; margin: 10px; }
	</style>
	<script type="text/javascript" src="soapclient.js"></script>
	<script type="text/javascript">
	
	function theStationDashBoard()
	{
		var pl = new SOAPClientParameters();
		// This is a station code, use this to lookup info on stations or whatever it does really - you should know that
		// the pl. is for adding parameters that get passed to the webservice
		pl.add("crsCode", "AAP"); 
		SOAPClient.invoke("http://184.106.159.143:8080/FirstGroupRailApps/services/RailAppsCAWS", "getDestinationStationDashboard", pl, true, Station_callBack);
	}
	
	function Station_callBack(r, xmlResponse)
	{
		var responseXML = xmlResponse.documentElement;
		var stationName = responseXML.getElementsByTagName("stationName");
		var expArrival = responseXML.getElementsByTagName("destExpArrival");
		var trainID = responseXML.getElementsByTagName("trainID");
		var strStationlist = '';
		
		for (var i=0; i < stationName.length; i++)
		{
			strStationlist += "Train: " + trainID[i].firstChild.nodeValue + " for " + stationName[i].firstChild.nodeValue + " Expected to Arrive: " + expArrival[i].firstChild.nodeValue + "<br />";
		}
		
		document.getElementById("showOutput").innerHTML = strStationlist;
	}
	
	</script>
</head>
<body>
    <form id="frmDemo" name="frmDemo" action="" method="post">
    <div>
        <a name="d1"></a>
        <h2>DEMO SOAP: "Hello Ravi!"</h2>
        <p>The simplest example you can imagine (but maybe not the most fanciful...):</p>
        <input type="button" value="Click to get Station info for AAP" onclick="theStationDashBoard();" />
        <div id="showOutput"></div>
    </div>
    </form>
</body>
</html>

4.  Go and run the web page in chrome from localhost location - or where ever you're developing.

5.  Click on button and wait for results

6.  Use the web inspector to see the full SOAP response.

7.  Take note of train information.

8.  Send The_Anomaly your email so he can send you the bill!

9.  Also mark as solution so others can know and press LIKE if you have been helped.

 

Example uses your SOAP client ajax and not jQuery.  Not sure if this will conflict but thats your problem from here.

New subject becomes new forum thread. Enjoy.

 

 

If it helped you, click like. :smileyhappy:
Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: why it goes to if condiation..?

Many many thanks

 

sir every time you help .........again thanks sir

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

Re: why it goes to if condiation..?

thanks Sir 

 

Last how to change the setting of firefox..?

 

if someone is interested to run this program in firefox ? how to change the the setting ?

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

Re: why it goes to if condiation..?

Great example is running in chorme ..thanks but not running in firefox how to change setting in firefox..?

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: why it goes to if condiation..?

to enable cross domain ajax without editing config files by hand. Type “about:config” in your URL bar, then right click on the list of preferences and select the New → String contextual menu. Add capability.policy.default.XMLHttpRequest.open as key name and allAccess as value. I do not remember if this is taken into account immediately or if you have to reboot. Done!

If it helped you, click like. :smileyhappy:
Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: why it goes to if condiation..?

it is not working same error display wsdl is null..:smileysad:

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

Re: why it goes to if condiation..?

same example as you give work fine in chrome but not work in firefox,i also done setting..:smileysad:

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

Re: why it goes to if condiation..?

Sir Last Please check your code on firefox..If it is running please let me know..

Please use plain text.