BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   NullPointerException with ksoap2 (http://www.blackberryforums.com/developer-forum/107187-nullpointerexception-ksoap2.html)

zimmi 11-29-2007 06:09 AM

NullPointerException with ksoap2
 
hello again,

i try to call a web service from my BB-simulator using ksoap2. i use following code:

Code:

SoapObject client = new SoapObject("urn:namespace","Method_name");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
client.addProperty("Parameter_name","String_value");

HttpTransport ht = new HttpTransport("http://www.mydomain.de/web_service_name.asmx");
ht.call("urn:namespace",envelope);
System.out.println(envelope.getResponse().toString());

i get a NullPointerException at ht.call(...)
and have no idea why?

please help!

zimmi 11-29-2007 08:32 AM

obviously i'm doing something wrong, but i don't get it...
can somebody please post the code to call this little example webservice:

currconvert

that would help me alot. thx

zimmi 11-30-2007 02:52 AM

can somebody please help me?

i'm really stuck with this problem.

richard.puckett 11-30-2007 06:59 PM

I hope you're not actually passing in values such as "Parameter_name". :?

Here's a snippet that works with webservicex (not the dotnet "ugly hack" here).

Code:

SoapObject request = new SoapObject("http://www.webserviceX.NET", "GetCountryByCountryCode");
request.addProperty("CountryCode", "US");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransport ht = new HttpTransport("http://www.webservicex.net/country.asmx");
ht.call("http://www.webserviceX.NET/GetCountryByCountryCode", envelope);
add(new RichTextField("Response: " + envelope.getResponse()));


zimmi 12-03-2007 03:46 AM

thank you very much, richard.

finally i can call my .net web service.

btw: no, i didn't used the values i posted earlier, lol.


All times are GMT -5. The time now is 10:20 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.