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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
javaway
Posts: 5
Registered: ‎02-01-2010
My Carrier: ATT & Verizon

Calling a Web Service from Eclipse / BlackBerry plug-in

Hello,

I would like to call a XML-RPC service from my Eclipse (BlackBerry plug-in) project.  Where do I start?

Any samples or directions would be appreciated.

Thank you

Please use plain text.
Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009

Re: Calling a Web Service from Eclipse / BlackBerry plug-in

Welcome.

 

There are two main things you'd need to know to accomplish what you'd like to do.

 

You need to know how to make a connection:

 

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

 

You need to know how to read XML. See the XMLDemo that comes packaged with your Eclipse installation.

 

If you have any more questions, post away.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Please use plain text.
Developer
kanna
Posts: 70
Registered: ‎01-02-2009

Re: Calling a Web Service from Eclipse / BlackBerry plug-in

There are two common approaches to use webservice in Blackberry.


1. Using the stubs using JSR 172. Read this for more J2ME Web Services
2. Using ksoap2 as a framework. kSoap -> http://ksoap2.sourceforge.net/

 

For stub generation method this might be usefull

http://www.ibm.com/developerworks/wireless/library/wi-jsr/

http://www.cs.wichita.edu/~chang/lecture/cs898t/program/how-j2me-webservice.html

 

For ksoap this post might be usefull.
http://www.blackberryforums.com/developer-forum/140930-blackberry-jde-ksoap-noobs.html

http://www.blackberryforums.com/developer-forum/155972-blackberry-ksoap2-tutorial.html

 

---------------------
Best Regards,
Kannabiran.
---------------------
Don't forget to mark your post as solved if you got answer. And give kudos.
Please use plain text.
New Developer
javaway
Posts: 5
Registered: ‎02-01-2010
My Carrier: ATT & Verizon

Re: Calling a Web Service from Eclipse / BlackBerry plug-in

Thank you so much guys for providing those excellent links. I can't wait to get my hands dirty.

Does anyone have any recommendations on the two protocols, JSR 172 or ksoap2? What are the pro and cons of the two?

Please use plain text.
Developer
kanna
Posts: 70
Registered: ‎01-02-2009

Re: Calling a Web Service from Eclipse / BlackBerry plug-in

The kSOAP2 API is relatively simple to use, with a comprehensive serialization process.

Dealing with the JSR172 API is more difficult because it requires a solid knowledge about the Web Services domain, particularly the WSDL language. For example, it is very tedious to find the appropriate encoding style to use, as well as the XSD tags that have been restricted, such as the useful xsd:choice tag (unordered sequence of tags). Moreover, there exists some problems with list structure handling during unmarshalling of the server response with the JSR172.

---------------------
Best Regards,
Kannabiran.
---------------------
Don't forget to mark your post as solved if you got answer. And give kudos.
Please use plain text.
Developer
kanna
Posts: 70
Registered: ‎01-02-2009

Re: Calling a Web Service from Eclipse / BlackBerry plug-in

The kSOAP2 API is relatively simple to use, with a comprehensive serialization process.

Dealing with the JSR172 API is more difficult because it requires a solid knowledge about the Web Services domain, particularly the WSDL language. For example, it is very tedious to find the appropriate encoding style to use, as well as the XSD tags that have been restricted, such as the useful xsd:choice tag (unordered sequence of tags). Moreover, there exists some problems with list structure handling during unmarshalling of the server response with the JSR172.

---------------------
Best Regards,
Kannabiran.
---------------------
Don't forget to mark your post as solved if you got answer. And give kudos.
Please use plain text.