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

Java Development

Reply
Developer
Fermin
Posts: 32
Registered: ‎09-03-2008
My Device: Not Specified
Accepted Solution

Consuming a Web Service

Hey,

 

Newbie here and was wondering if someone could point me in the right direction of writing a class to connect to a webservice?  I'm using Blackberry JDE plugin for Eclipse.  I've tried searching through some forums but most is to do with ksoap plugin which i'm having difficulty with so thought i'd write my own class.  Any papers, samples etc. would be much appreciated.

 

Tried to search through blackberrys developer section but to be honest i find the site awful and can never find what i'm looking for!

Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Consuming a Web Service

[ Edited ]

Look at here

 

There is a part that describes work with webservices

 

To test webservice I would recommend you to use soapUI

 

 

Message Edited by rafo on 09-03-2008 02:11 PM
----------------
if your issue solved set "Solution" mark at the relevant post
Developer
Fermin
Posts: 32
Registered: ‎09-03-2008
My Device: Not Specified

Re: Consuming a Web Service

Thanks rafo.  I'm currently using Eclipse with the Blackberry plugin and I don't really want to use the MDS Studio, is it possible to connect to a webservice without using this?

 

Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Consuming a Web Service

[ Edited ]

As far as I know there is no JSR172 support in RIM API.

 

In this case you need to prepare manually request and also manually parse response xml.

 

Try to use j2me xml libs like kSOAP

Message Edited by rafo on 09-04-2008 12:02 PM
----------------
if your issue solved set "Solution" mark at the relevant post
Developer
Fermin
Posts: 32
Registered: ‎09-03-2008
My Device: Not Specified

Re: Consuming a Web Service

I've tried using ksoap and i'm getting an error about files missing inside the jar file. 

 

Do you know if it is worth manually writing requests and parsing the response or is it too much work?  Do you know where i can find some guides/hints/samples of this?

 

Sorry for asking so much but i am struggling to find much information on developing on Blackberry.

Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Consuming a Web Service

[ Edited ]

Check links below:

 

The First

 

The Second

 

Preparing all steps and check responses manually- it is not trivial, but possible task.

Message Edited by rafo on 09-04-2008 12:17 PM
----------------
if your issue solved set "Solution" mark at the relevant post
Developer
Fermin
Posts: 32
Registered: ‎09-03-2008
My Device: Not Specified

Re: Consuming a Web Service

Thanks, i'll check them out now.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Consuming a Web Service

Have you tried kSOAP2 ?             

 

 

----------------
if your issue solved set "Solution" mark at the relevant post
Developer
someswararao
Posts: 40
Registered: ‎07-16-2008
My Device: Not Specified

Re: Consuming a Web Service

Hi,

 

I have developed a small application based on the webservices, by following these steps...

 

1. Created a webservice and published.

2. By using the SUN J2ME Wireless Toolkit, point the wsdl file and generate  stubs..

3. After generating the stubs, import the classes into u r project and access like a simple java classes..

 

please correct me, if i am wrong... 

 

Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Consuming a Web Service

[ Edited ]

Check the following link for an example: Calling .NET WebService from BlackBerry With kSOAP2

 

There is a report for an error, but the approach is correct.

 

Also check this link

Message Edited by rafo on 09-04-2008 03:11 PM
----------------
if your issue solved set "Solution" mark at the relevant post