How to call a .NET web service from Blackberry Simulator?

Rajapandian picture Rajapandian · Jul 22, 2009 · Viewed 10.6k times · Source

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.

Answer

Fermin picture Fermin · Jul 22, 2009

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);