SoapFault - faultcode: 'soap:Server' faultstring: 'java.lang.ClassCastException@19b4163 while invoking public abstract java.util.List

634 views
Skip to first unread message

Pedro

unread,
May 7, 2012, 9:03:05 PM5/7/12
to ksoap2-android
Hello.
I'm trying to parse a response from a Webservice but i keep getting
the error on the topic.
The method that i'm invoking response is a list of elements. I used
SoapUI to make an invokation and it succeeded but when i try with
ksoap i get that error.
The method that i'm calling has the following arguments:

arg0: (String) - goes empty;
arg1: (Long) - receives a long; I'm using 1, that is a valid value.
arg2: (String) - receives allways the value "A";
arg3: (boolean) - receives allways the value "false";
arg4: ( String) - receives allways the value "CSW";

So in SoapUI the invokation goes:

(....)
<web:findEquipment>
<!--Optional:-->
<arg0></arg0>
<!--Optional:-->
<arg1>1</arg1>
<!--Optional:-->
<arg2>A</arg2>
<arg3>false</arg3>
<!--Optional:-->
<arg4>CSW</arg4>
(...)


In the Java code i'm using this way to add the properties (i don't add
arg0 since it's value is null):

PropertyInfo equipType = new PropertyInfo();
equipType.setType(PropertyInfo.LONG_CLASS);
equipType.setName("arg1");
equipType.setValue(1);

PropertyInfo arg2 = new PropertyInfo();
arg2.setType(PropertyInfo.STRING_CLASS);
arg2.setName("arg2");
arg2.setValue("A");

PropertyInfo showInactive = new PropertyInfo();
showInactive.setType(PropertyInfo.BOOLEAN_CLASS);
showInactive.setName("arg3");
showInactive.setValue(false);

PropertyInfo companyCode = new PropertyInfo();
companyCode.setType(PropertyInfo.STRING_CLASS);
companyCode.setName("arg4");
companyCode.setValue("CSW");

request.addProperty(equipType);
request.addProperty(arg2);
request.addProperty(showInactive);
request.addProperty(companyCode);


envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new
HttpTransportSE(URL);
androidHttpTransport.debug = true;

try {
androidHttpTransport.call(SOAP_ACTION, envelope);

SoapObject result = (SoapObject)envelope.getResponse();
} catch (Exception e) {
e.printStackTrace();
}

I get the error in the line SoapObject result =
(SoapObject)envelope.getResponse();


Any clue of what is the problem?

Manfred Moser

unread,
May 8, 2012, 5:54:09 PM5/8/12
to ksoap2-...@googlegroups.com

Your server is having the problem.. Debug there...

Mohd Irfna

unread,
Sep 25, 2012, 2:11:41 AM9/25/12
to ksoap2-...@googlegroups.com
HI   Everybody
I have the same problem
Please help me
Thanks in advance

Manfred Moser

unread,
Sep 25, 2012, 11:56:28 AM9/25/12
to ksoap2-...@googlegroups.com
I can't help you directly but I would suggest to just set a breakpoint
in the code where the exception occurs and check out what object it
really is right then and there..

manfred
Reply all
Reply to author
Forward
0 new messages