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

MKS TYPE 260 CONTROLLER (4 TOTAL) & TYPE 261 DISPLAYS (2) IN MAINFRAME
$150.0
MKS TYPE 260 CONTROLLER (4 TOTAL) & TYPE 261 DISPLAYS (2) IN MAINFRAME pictureHAMEG Mainframe HM8001 w/Function Generator HM8030-4 Digital Multimeter HM8011-3
$674.99
HAMEG Mainframe HM8001 w/Function Generator HM8030-4 Digital Multimeter HM8011-3 pictureAgilent E8401A 13-Slot VXI Mainframe
$249.0
Agilent E8401A 13-Slot VXI Mainframe pictureTektronix 7603 Mainframe Oscilloscope (Parts/Repair)
$109.99
Tektronix 7603 Mainframe Oscilloscope (Parts/Repair) pictureJDSU T-BERD 8000 Mainframe, Loaded with Extras, Excellent Condition
$2143.0
JDSU T-BERD 8000 Mainframe, Loaded with Extras, Excellent Condition picture






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