08-01-2008 03:22 PM
Quote from the previous forum:
We do not have any BlackBerry specific samples on this, however you can refer to the JSR 172 samples available on the Internet.
10-06-2008 11:39 AM
I've been searching the forums for examples of accessing a web service from a java app on the BB handset. People have included snippets, but nothing to help newbies understand what is needed. I have tried to follow examples using kSOAP2, but I get server-side errors that I don't see if I simply access the web service through a desktop browser.
I have tried to understand how to use the Sun Wireless toolkit to auto-generate stubs, but none of the tutorials I've found seem to be complete - they assume complete familiarity with the toolkit, which is new to me too.
When I have attempted to workout the gaps in these tutorials, the application errors anyway because the imports included in the auto-generated files aren't recognised:
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.microedition.xml.rpc.Operation;
import javax.microedition.xml.rpc.Type;
import javax.microedition.xml.rpc.ComplexType;
import javax.microedition.xml.rpc.Element;
What are these, and do I need to replace them for BB equivalents?
Basically, what I've done is create a simple webservice called HelloWorld, that accepts one parameter. It then returns 'HelloWorld + parameter'.
I've then pointed the Sun Wireless toolkit stub generator to the WSDL, and imported the generated files in the BB JDE.
Then, I've run this code:
Service1Soap_Stub test = new Service1Soap_Stub();
try{
String str = test.helloWorld("This is my parameter");
System.out.println(str);
}catch(Exception ex){
System.out.println(ex.toString());
}
Is this correct??
Any help, advice, pointers, samples... anything would be much appreciated!
Johan
10-06-2008 03:18 PM
10-07-2008 05:22 AM
Thanks again Mark!
I have been using version 4.3.0 of the JDE, with a variety of simulators, however, I'm don't think that any of these simulators are 4.3.0 or above.
I've just downloaded JDE 4.6.0, and tried the same code with a Bold simulator, and it works just as I would expect.
Again, I am very thankful for your help - from a much happier Johan!
11-22-2008 12:44 AM
Hi Mark,
You mentioned that JSR172 is supported only on devices with 4.3+ OS Versions.
I have a question. If let's say I have a device that has 4.2 OS Version, can i update the version of my OS to higher than 4.3 so that i can be able to support JSR172? Is this possible?
Or do i have to purchase another device that has already an OS version of 4.3+?
Hope to hear from you soon.
11-22-2008 10:53 AM
That depends on the device and your carrier.
Check the carrier web site to find the latest OS version published for the device. OS 4.3 is available from almost every carrier as an upgrade, 4.5 is available for the Curve and Pearl devices from several carriers.
You can also download the BlackBerry-generic versions of the OS distributions from BB Universe site.
11-26-2008 08:09 PM
12-03-2008 09:25 AM
12-03-2008 11:49 PM
12-04-2008 03:09 PM
Hi there,
Good new for people from USA and Developed countries, for people like me, in Latin America, there is no update to version 4.3.0+ for any carrier. I tried to update a BB with a package for other carrier and the BB just stop work, I think there is some code or config for the specifics carrier. In some forums, I found that certain carriers and countries can be compatible, with other just not.
If you cannot upgrade to 4.3+, just use KSOAP, refer to the ksoap2 page at sourceforge. It works fine, but have some difficulties. JSR 172 is just simple, you make a stub and consume even complex objects. Beatyfull.
Regards!