You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by we...@mail.dcu.ie on 2003/04/28 13:58:46 UTC
Exception in SOAPBody.getChildElements(Name name)?
Hi,everyone:
I added a few extra elements into the SOAPBody on my client side(using SOAPBody.addBodyElement(Name
name);), then send the SOAP message to the server.
On the server side, I'm processing the request Message within the MessageContext
in my handler. I'm trying to parse those elemets from the SOAPBody , but
when I call "SOAPBody.getChildElements(Name name)", the program throws a
"java.lang.ClassCastException: org.apache.axis.message.RPCElement" exception.
The "Name" object is the correct one(the same as the one I used on client
side). but "SOAPBody.getChildElements()" is working.
It seems that I can't use this method on the SOAPBody in my handler, but
the "SOAPHeader.getChildElements(Name name)" method is working fine on the
SOAPHeader in my handler!?
on the client side:
Name encrytDataBody = env.createName(SOAPConstants.ENC_DATA,
SOAPConstants.WSSEC_NS,
SOAPConstants.DCUSECNS);
SOAPBodyElement dataShe = (SOAPBodyElement)body.addBodyElement(encrytDataBody);
on the server side:
Name encrytDataBody = env.createName(SOAPConstants.ENC_DATA,
SOAPConstants.WSSEC_NS,
SOAPConstants.DCUSECNS);
Iterator it = body.getChildElements(encrytDataBody);//Exception here
any idea?