4

I have to call a .NET web service (http://192.168.1.14/CG/authentication.asmx) from the Blackberry Simulator. Already i have done it in Android with KSOAP2, but i have no idea about how to do this in Blackberry. Can i use KSOAP2 in Blackberry? If i can please give some code snippets. Also please tell if you know any other ways to do this.

JJD
  • 50,076
  • 60
  • 203
  • 339
Rajapandian
  • 9,257
  • 24
  • 74
  • 86

3 Answers3

3

I've not used KSOAP2 before but I know that you can use it for Blackberry.

To call web services I use the Sun Java Wireless Toolkit (WTK) to generate stubs from your webservice's WSDL file, which should probably be http://192.168.1.14/ CG/authentication.asmx?wsdl for you.

You can then import the files that the WTK generates into your project to call your web methods using something along the lines of:

//Generated stub file
Service1Soap_Stub stub = new Service1Soap_Stub();

//Web service method
result = stub.methodName(param1, param2);
Fermin
  • 34,961
  • 21
  • 83
  • 129
  • do you know any good tutorials for generating the stubs? i downloaded the WTC but cant figure it out. – mtmurdock Oct 11 '10 at 17:45
  • @mtmurdock - It's actually pretty straight forward once you get going, this tutorial looks okay http://www.bestcoder.net/?p=117. – Fermin Oct 12 '10 at 11:25
  • Sun Java Wireless Toolkit has issue in stub generation for DOT NET webservice. They were just entity files and Web service connector was not present in it. – RedBottleSanitizer Apr 09 '13 at 19:47
1

Alternatively you can use SAX and the standard J2ME libs. The following link is a good tutorial on how to accomplish this: http://www.simplified-tech.com/website/webapp.nsf/webpages/ArticlesBBWebServices

0

You can look at WSClient++ which generates code that is free from reflection and ideal for mobile platforms.

Akash Kava
  • 39,066
  • 20
  • 121
  • 167