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