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 Mi...@servicecanada.gc.ca on 2007/07/09 20:03:45 UTC

How to rewrite the soap message?

Hi,

I'm trying to rewrite wss4j (the WS-Security library used by Rampart) to be compatible with axis2. So far I've been able to figure out what new classes and methods replace the old ones, but there's one thing that's got me stumped.

I'm at the place where the security headers have been processed, so parts of the SOAP message might have been encrypted or signed or whatever. These lines then essentially rewrite the SOAP message from a Document:

-----------
org.w3c.dom.Document doc; // assume this was defined above
org.apache.axis.Message sm;	// assume this was defined above

SOAPPart sPart = (org.apache.axis2.SOAPPart) sm.getSOAPPart();	    
ByteArrayOutputStream os = new ByteArrayOutputStream();
XMLUtils.outputDOM(doc, os, true);
sPart.setCurrentMessage(os.toByteArray(), SOAPPart.FORM_BYTES);
-----------

Now, the new axis2 and axiom libraries don't have a class called SOAPPart, and I'm not sure how to pull this off. I do have objects of these classes handy:

org.apache.axis2.context.MessageContext;
org.apache.axis2.description.AxisMessage;

Can anyone please give me a hint on how to proceed?

Many thanks
Michael Davis

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org