Thank you for visiting the BlackBerry Support Community Forums.
- Kevin Michaluk, Founder, CrackBerry.com
04-05-2011 08:32 AM - edited 04-05-2011 08:39 AM
var celcius = document.DemoForm.cel.value;
var xml= event.result.value; //var json = $.xml2json(xml); document.write("<div
<body onload="InitializeService()" onresult="ShowResult()" id="service" style="behavior:url(webservice.htc);background-col
<td>Celsius To Fahrenheit </td>
<td> <input type="text" name="cel"/></td>
Solved! Go to Solution.
04-05-2011 08:51 PM
04-06-2011 01:24 AM
I declared there <body id=service>
Its work fine when i run as html in IE broswer.
while i try to run in webworks, its gives error.
04-06-2011 07:40 AM
it looks like you are using some kind of .NET specific web services call. Does this same call work in Chrome? Or does it only work in IE.
04-06-2011 09:13 AM
The issue is that you are using IE and .NET specific code. The Browser on a BlackBerry is WebKit based (same engine behind chrome). Using .NET/IE specific code will not run on BB, iOS, Android, WebOS.. it will only run on IE
04-06-2011 10:16 AM
Here is a thread that I had created around calling web services using standard AJAX calls.
04-07-2011 05:14 AM - edited 04-07-2011 05:15 AM
I tried above given link example to call web service.
Still its run only in IE, not in other browser.
Pls help me to get out of this trouble.
04-07-2011 09:39 AM
Balaji, you're clearly not following the link Tim provided if this still isn't working. The code you've shown above makes a call to service.useService. (For those of you following along at home, turns out there's a really bizarre feature in IE that lets you call a webservice and control the loading and callback method based on an element in your DOM. More infor here, http://www.webreference.com/js/column98/6.html )
useservice is only supported in Internet Explorer. IE has a long history of supporting non-standard APIs. You shouldn't use these APIs for because you'll run into issues on other browsers. The Playbook browser is based on the Webkit engine, which also underlies Chrome and Safari. It's generally considered one of the top rendering engines out there, so you should be happy you have access to it.
Instead of using useService, make a normal Ajax call to your webservice. You can do this with a straight XmlHttpRequest object, but I'd suggest using a library like jQuery. Search for a SOAP plugin for jQuery to make parsing the response easier.