Has anyone here been using ksoap2 with complex web services? I have gotten basic web service calls working with no problem. But in the project I am working on we have nested classes and data in almost all of the webservice calls and I am trying to use the ksoap2 ClassMap functionality to get my java objects populated. Even using it on a simple webservice call I can not seem to get the mapping correct. I end up getting ClassCastExceptions thrown. I have been able to view the data using the debug functionality in ksoap2 and the data I am getting should match up just fine with what object I am trying to cast the data to, but it doesn't work for some reason. If anyone has hints or worked on more complex webservice calls with ksoap let me know I could use all the help I can get right now on this. Examples would be good too. I have yet to find examples for ksoap that use complex types and nest class data structures.

I have been struggling to get this preverified and wasted a whole day on that.

Been working on J2ME directly and boss wanted me to use BB JDE as the end device to use its the BB

Quote:

Originally Posted by tbi

Thanks for posting this tutorial! I'm trying to setup ksoap2 with Blackberry JDE plugin but I have problems with couple of the steps you mentioned:
When I right click on the project, I can't find the option "Add file to Blackberry Project" - can someone please confirm if this is a mistake or am I missing something?

Its "Add File to Project"

Quote:

Originally Posted by tbi

When exactly does ksoap2.jar get created? I've added the pre-verified ksoap2 library (attached in the original post) to my project but I can't find "ksoap2.jar".

Any help/suggestions are welcome

Thanks!

When adding the file, on File Type just select "All the files" so the jar file appears and then add it to the new project

Are you using Eclipse or JDE? This tutorial is for Eclipse, I dont know how to do some steps at JDE.

I am Using Eclipse Ver 3.4.0 and BlackBerry JDE Plug-in For Eclipse Ver. 1.0.0.50 and i also don't See "Add file to Blackberry Project". and the Ksoap2.jar file is not created. I see jar files for all my other project but not for the Ksoap2 library project.

this will give you an output folder in your bin directory (or probably whatever directory you run the preverify utility from (I'm not sure, I've just ran it from the bin directory of the JDE)

In the output folder will be a ksoap-whatever.jar file that is slightly bigger than the original .jar file.

You're going to (this is important) want to create a "lib" folder under the project folder that you want to attach the ksoap2 to.

Once you have that, what you want to do is create a new project

Once you have done that change the project type (project->properties->application tab) from the CDLC App to Library, and import the ksoap2.jar that was created when you ran the preverify (the one that you hopefully moved to the "lib" path under your project path.

Now, build that project, and you should get a ksoap2.cod file as output, which is fine, leave it alone.

Now, in your project (this should all have occurred in the same workspace) go to project->dependencies-> and specify that it is dependent on the ksoap2 project.

That should allow you to import the ksoap library.

(Though I do wonder if there's anyway to get the IDE to recognize the ksoap2 classes so it'll automatically give you the function definitions and class definitions)

Now, that handles the attaching of the files.

My questions are

1. Where do I get a MDS Simulator? (I checked the rim site, but I can't find an MDS Simulator anywhere.)

2. Can some one help me with this, on the device the following is throwing a
java.io.ioexception: Tunnel timed out

1) I tried to run this tutorial but the icon is not being displayed on the simulator & according to me it needs a .cod file which is not being generated.
2) The line, " Right click on the project->Add file to Blackberry Project-> Select the ksoap2 jar from the "lib" folder. " , is too much confusing as there is no such option displayed in eclipse. So anyone could plese upload a screen shot as to what this line refers to.

if it runs with the mds on the simulator and not on the actual device that's because using http services on the actual device requires that the app be SIGNED. You have to apply to RiM for a signing authority.

When you compile the app, it most certainly warns you about that at the top of the BUILD responses.

First of all, BIG thanks to sickned At least for the attempt to show us
how it should look like (please, no offence intended).
But as you might already notice
the attached code does not compile out of box, - problems on the lines 26 and 43.
First should be replaced with:

PHP Code:

Ksoap2Demo theApp = new Ksoap2Demo();

second:

PHP Code:

public Ksoap2DemoScreen (){

Only after that I could see something on the simulatorxxx8217;s screen
(Project type set to CLDC Application).
Next, it would be good if this example had some valid data/parameters and
actually retrieved some stocks from some sites.
Or at least gave (me) a 'hint' what to do
...
P.S. I'm on JDE 4.7.