I am trying to consume a web service from android and I got that the
application send the "XML right format" needed for my WebService. I
checked with a sniffer and test it in SOAPUI client.
I can see that requestDump and respondDump are filled with the in and
out information but the application failed in the line:
aht.call(SOAP_ACTION_1, soapEnvelop);
It goes to the catch:
catch (Exception e)
but e.toString() is equals to "null".
I cannot see any exception that give me a clue of the problem. I am
just blind.
Any suggestion or possible errors.
I appreciate your help.
Below the Main Code:
where
InClass and OutClass implements KvmSerializable.
In InClass = Contains 3 Strings objects
Out OutClass = Contains 6 Strings 1 Integer and 2 User defined
classes that also implements KvmSerializable and inside them there are
Strings and Integer variables.
Code:
===============================================
String NAME_SPACE_1 = "http://name_space";
String URL_1 = "http://<server>:<port>/XXX/XXXX/Service?wsdl";
String METHOD_NAME_1 = "searchMethod";
String SOAP_ACTION_1 = "";
SoapObject request = new SoapObject(NAME_SPACE_1, METHOD_NAME_1);
In InClass = new In();
In.mS = "1234";
PropertyInfo PI_In = new PropertyInfo();
PI_In.setName("In");
PI_In.setValue(InClass);
PI_In.setType(InClass.getClass());
request.addProperty(PI_In);
//Set the web service envelope
SoapSerializationEnvelope soapEnvelop = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
//envelope.dotNet = false;
soapEnvelop.setOutputSoapObject(request);
//Remove extra entries in XML to format needed input XML
soapEnvelop.implicitTypes = true;
soapEnvelop.setAddAdornments(false);
//Setting output parameters
Out OutClass = new Out();
soapEnvelop.addMapping(NAME_SPACE_1, "Out",new Out().getClass());
HttpTransportSE aht = new HttpTransportSE(URL_1);
aht.debug=true;
//Call the web service and retrieve result
try{
aht.call(SOAP_ACTION_1, soapEnvelop);
}
catch (IOException e) {
outputTextKSoap.setText("GetVersion " + "IOException: "
+ e);
} catch (XmlPullParserException e) {
outputTextKSoap.setText("GetVersion " +
"XmlPullParserException: " + e);
}
catch (Exception e) {
if(e != null && e.toString().equals("null"))
outputTextKSoap.setText("StackTrace: " +
e.getStackTrace().toString());
else
outputTextKSoap.setText("Exception is NULL");
}
}
requestDump
==========
<v:Envelope
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns:d="http://www.w3.org/2001/XMLSchema"
xmlns:c="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<n0:searchMethod xmlns:n0="http://name_space">
<In>
<mS>1234</mS>
</In>
</n0:searchMethod>
</v:Body>
</v:Envelope>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en