BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 11-29-2007, 06:09 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8800
PIN: N/A
Carrier: T-Mobile
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default NullPointerException with ksoap2

Please Login to Remove!

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!
Offline  
Old 11-29-2007, 08:32 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8800
PIN: N/A
Carrier: T-Mobile
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Offline  
Old 11-30-2007, 02:52 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8800
PIN: N/A
Carrier: T-Mobile
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

can somebody please help me?

i'm really stuck with this problem.
Offline  
Old 11-30-2007, 06:59 PM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Join Date: Oct 2007
Location: Seattle, WA
Model: 9020
PIN: N/A
Carrier: T-Mobile
Posts: 212
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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()));
Offline  
Old 12-03-2007, 03:46 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8800
PIN: N/A
Carrier: T-Mobile
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Lot of 19 1N4733A Zener Diode 5.1V, 1W Fairchild Semiconductor
$1.85
Lot of 19 1N4733A Zener Diode 5.1V, 1W Fairchild Semiconductor pictureFERRAZ SHAWMUT A50QS50-4 Form 101 Semiconductor Fuse
$49.99
FERRAZ SHAWMUT A50QS50-4 Form 101 Semiconductor Fuse pictureMP1555 - Motorola PNP Germanium Transistor Semiconductor (6 pcs.)
$9.95
MP1555 - Motorola PNP Germanium Transistor Semiconductor (6 pcs.) pictureUNUSED ALLEN BRADLEY MULTIFUNC SEMICONDUCTOR CONTACTOR 480V 50A 156-B50BC1 SER.A
$34.99
UNUSED ALLEN BRADLEY MULTIFUNC SEMICONDUCTOR CONTACTOR 480V 50A 156-B50BC1 SER.A pictureNew MERSEN Gould FERRAZ SHAWMUT A70P700-4 SEMICONDUCTOR FUSE New old stock NOS
$125.0
New MERSEN Gould FERRAZ SHAWMUT A70P700-4 SEMICONDUCTOR FUSE New old stock NOS picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.