BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 05-06-2009, 01:53 PM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting 'SoapException' while making a WebService Call

Please Login to Remove!

BlackBerry Java Application
JDE 4.5

I use 'ksoap2'. Please take a look at the following code and tell me whatz wrong:

public void GetWhoIS()
{
String serviceUrl = "h t t p : / / w w w. webservicex.net / whois . asmx";
String serviceNamespace = "h t t p : / / w w w . webservicex . net";
String soapAction = "h t t p : / / w w w . webservicex . net / GetWhoIS";
String methodName = "GetWhoIS";

SoapObject rpc = new SoapObject(serviceNamespace, methodName);
rpc.addProperty("HostName", "w w w. google. com");

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.bodyOut = rpc;

HttpTransport ht = new HttpTransport(serviceUrl);
ht.debug = true;
ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

String result = null;

try
{
ht.call(soapAction, envelope);
result = (envelope.getResult()).toString();
Dialog.alert("WS Call Success: " + result);
}
catch(org.xmlpull.v1.XmlPullParserException ex2){
System.out.println(ex2.toString());
Dialog.alert("XmlPullParserException Error: " + ex2.toString());
}
catch(Exception ex)
{
result = ex.toString();
Dialog.alert("Exception Error: " + result);
System.out.println(result);
}
}


When I call this code I get the following exception:

Exception Error: SoapFault - faultcode: 'soap:Server' faultstring: 'System.Web.Services.Protocols.SoapException: Server was unable to process request. --->System.ArgumentNullException: Value cannot be null.
at
whois.whois.GetWhoIs(String HostName) --- End of inner exception stack trace ---' faultactor: 'null' detail: org.kxml2.kdom.Node@f2181c19


As far as I understood I use the 'addProperty' to set the parameter value.

Can anyone tell me what I'm doing wrong?

Thanks.
Athma.
Offline  
Old 05-15-2009, 03:42 PM   #2 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default incompatible with webservicex.net

I guess w w w. webservicex.net is incompatible with soap.

I've tried exactly the same code (just changed the serviceUrl, serviceNameSpace, soapAction and methodName values) with a different webservice (our company's one) and it works pretty good.

Just curious... does anybody have any success using w w w.webservicex.net?
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

Vintage 1/2" Drive MAC VUI 166T 6 Point Impact Swivel Socket
$11.95
Vintage 1/2GW Instruments MacADIOS - Vintage Mac Lab Interface 411
$99.0
GW Instruments MacADIOS - Vintage Mac Lab Interface 411 pictureAssorted Vintage Specialty Hand Tools - Matco,Mac,Tail Pipe Cutter, Chain Wrench
$96.0
Assorted Vintage Specialty Hand Tools - Matco,Mac,Tail Pipe Cutter, Chain Wrench pictureNew Vintage Velocette MAC Raw 1948 to 1953 Petrol Fuel Gas Tank
$280.0
New Vintage Velocette MAC Raw 1948 to 1953 Petrol Fuel Gas Tank pictureMAC Tools Steel Punch SMR6 Vintage USA
$5.99
MAC Tools Steel Punch SMR6 Vintage USA picture






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