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 Jose Miguel Selman <js...@bee.cl> on 2003/12/02 16:48:01 UTC

No deserialization context in a handler

Folks, I'm getting a java.lang.Exception: No deserialization context to use
in MessageElement.getValueAsType()! What I'm doing is replace the value of
the first parameter (in this case the only one) in a handler. For debugging
purposes I'm using the following code which throws that exception:

Message inMsg = msgContext.getRequestMessage();
Vector BodyElements = inMsg.getSOAPEnvelope().getBodyElements();
org.w3c.dom.Element element = ((SOAPBodyElement)
BodyElements.elementAt(0)).getAsDOM();
org.w3c.dom.NodeList nodelist = element.getChildNodes();
SOAPEnvelope se = inMsg.getSOAPEnvelope();
se.clearBody();
SOAPBodyElement sbe = new SOAPBodyElement(element);
se.addBodyElement(sbe);
inMsg.saveChanges();
msgContext.setRequestMessage(inMsg);

As you can tell, I'm just clearing the SoapBody and then appending a unique
child which happens to be the same dom element extracted from the original
soap envelope. However, when I add a second body element, by commenting
"se.clearBody()" it works just fine without the modified parameter though
(which is the main goal of this handler).

Cheers,

Jose M Selman