axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wenhao....@mail.dcu.ie
Subject Exception in SOAPBody.getChildElements(Name name)?
Date Mon, 28 Apr 2003 11:58:46 GMT
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?  


Mime
View raw message