BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 05-04-2009, 11:48 AM   #1 (permalink)
New Member
Join Date: Apr 2009
Model: 8300
Carrier: AT&T
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default using webservice in a BB Java application

Please Login to Remove!

I want to use a Web Service (developed in Java) in my BB Java application.

I spent quite some time surfing the old posts in these forums and found "LOT" of questions regarding my very requirement. Unfortunately I didn't find a single solid response which dictates the steps to do this with some authority.

I really don't have any preference in terms of which IDE I would use for my development. I'm fine with JDE or Eclipse Plugin.

I'm targeting my app on devices with OS versions 4.5 and higher. So I've downloaded and installed everything required to develop my app for OS 4.5 from and latest and greatest Eclipse Plugin too.

Coming back to my original question... The closest one related to how to start with a web service client posted by a user 'sickned' in this post:


But the problem is... I don't see some of the options he has indicated. For instance in my 'BB Eclipse Plugin IDE' I don't see...

'Right click at Eclipse and select "Add to build path"'

Right click where? I right clicked on the Eclipse, Library project, my Application... I don't see that option anywhere.

Next instruction...

Right click on the project->Add file to Blackberry Project-> Select the ksoap2 jar from the "lib" folder
again I don't find it.

I assume this could be because of the version of IDE I use.

Anyways I would really really appreciate if some one posts step by step instructions to...

1. Add a Web Reference to a BB Java project (assuming the .WSDL is available)
2. Make a simple Web Service call. (like 'ping' or something)

Thanks in advance.
Old 05-04-2009, 03:03 PM   #2 (permalink)
New Member
Join Date: May 2009
Model: 9530
Carrier: Verizon
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts

Unfortunatly, I'm no help with the Eclipse part, I use the JDE.

However, for the web service call, I'm not sure that you add a web reference. Using ksoap and a web reference seems redundant. Keep in mind, I'm used to using Visual Studio. ksoap wraps the call to the web service rather than the web reference.

The article that you referenced has a good example in the download file of creating the call to the web service. I've used that to create my web service calls and it works beautifully.
Old 10-28-2009, 09:25 AM   #3 (permalink)
New Member
Join Date: Oct 2009
Model: 8300
Carrier: adad
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Not able to find HttpTransportBasicAuth class

I am trying to call a webservice from a blackberry java app using ksoap2 library.In the sample programs given in some sites,they mentioned about HttpTransportBasicAuth class.
But I am not able to find the HttpTransportBasicAuth class in the org.ksoap2.transport package.I downloaded the preverified ksoap2 library from the old posts of this forum.
could any one help me on this.
Old 12-18-2009, 05:28 AM   #4 (permalink)
New Member
Join Date: Nov 2009
Model: 8900
Carrier: Airtel
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Unable to call the method ''

Tried out the sample application as a standalone java Appln.

HttpTransport transport = new HttpTransport("SOAP_ACTION_URL_HERE");

I was able to spawn out a new HttpTransport Object, but when using it to call the method"URL_HERE",envelope);

I'm getting the error=>

Exception in thread "main" java.lang.ClassFormatError: Method <init> in class ja
vax/microedition/io/Connector has illegal modifiers: 0x102
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at n Source)
at Source)
at$000(Unknown Source)
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at org.ksoap2.transport.ServiceConnectionMidp.<init>( Unknown Source)
at org.ksoap2.transport.HttpTransport.getServiceConne ction(Unknown Sourc
at Source)
at KSOAPDemo.main(
What cud' be the reason? Early advice would be great!
Old 12-28-2009, 12:07 AM   #5 (permalink)
Thumbs Must Hurt
Join Date: Aug 2005
Model: 8830
Carrier: Verizon
Posts: 144
Post Thanks: 0
Thanked 0 Times in 0 Posts


My suggestion would be to break this down into separate steps. First I would get the connection/communication with your web service working. Then once you are able to interact and retrieve data from your web service you can move on to trying to get the ksoap working.

I've read numerous posts where people have a difficult time getting everything installed and set up correctly to use ksoap. For me, I just read the response from the web service into a string and parse the elements myself.

If you need further help, it would be helpful if you provide your code so we can take a look at what you are doing.

I use HttpConnection to interact with my web service, and you have to make sure you handle the various responses you can get back from the initial POST. The response you are looking for to keep going is HTTP_OK (200), but depending on your web service you may get other responses that you need deal with first (401 or HTTP_UNAUTHORIZED means you need to provide user credentials, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, etc).

Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

APPLE 630-0895-B  VRAM 128K X 8 BOARD CARD VINTAGE pictureAPPLE 820-0522-A 630-0895-B LITE VRAM 128K X 8 BOARD >
APPLE 820-0522-A 630-0895-B LITE VRAM 128K X 8 BOARD > picture

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.