When in SoapSerializationEnvelope.bodyIn is stored
SoapFault, after calling
SoapSerializationEnvelope.getResult it throws
ClassCastException:
public Object getResult() {
--HERE--> KvmSerializable ks = (KvmSerializable) bodyIn;
return ks.getPropertyCount() == 0 ? null :
ks.getProperty(0);
}
That's because the SoapFault isn't subclass of
KvmSerializable...
Bye,
Petr
mr_peta@volny.cz
Logged In: YES
user_id=948541
Hi guys,
We stumbled over the same problem -- not only do Faults
trigger this behavior, also operations that return primitive
types, like a Boolean.
Second, the behavior of getResult is suboptimal when an
array is returned: getResult returns only the first(!) entry.
May I suggest the following patch:
public Object getResult() {
if (bodyIn instanceof KvmSerializable) {
KvmSerializable ks = (KvmSerializable) bodyIn;
if (ks.getPropertyCount() == 0) return null;
ks.getProperty(0)
}
}
Logged In: YES
user_id=948541
... sorry - submitted in the midst of writing...
here|s the complete code:
public Object getResult() {
if (bodyIn instanceof KvmSerializable) {
KvmSerializable ks = (KvmSerializable) bodyIn;
if (ks.getPropertyCount() == 0) return null;
return (ks.getPropertyCount() == 1) ks.getProperty(0) : ks;
} else
return bodyIn;
}
Logged In: YES
user_id=1282699
Thank you sir.. Please keep in touch over at the new home
for ksoap2 at ksoap2.sourceforge.net or
sourceforge.net/projects/ksoap2
Cheers
James.