Hi Xinjun,
Please see my comments:
On 9/26/06, Xinjun Chen <[EMAIL PROTECTED]> wrote:
Hi,
I am doing a project which do the signature for SOAP messages using wss4j.
I have a handler to do the signature.
Previously when using Axis, I can do the following:
public void execute(final javax.xml.soap.SOAPEnvelope envelope) {
org.w3c.dom.Document doc =
((org.apache.axis.message.SOAPEnvelope)envelope).getAsDocument();
// doing something to modify the doc, e.g., add more header and do
signature using wss4j.
// after modifying doc, the original envelope has updated.
}
but now in Axis2, the following give some problem:
public void execute(final org.apache.axis2.soap.SOAPEnvelope envelope) {
org.w3c.dom.Document doc =
Axis2Utils.getDocumentFromSOAPEnvelope(SOAPEnvelope env);
// doing something to modify the doc, e.g., add more header and do
signature using wss4j.
// after modifying doc, the original envelope has NOT updated.
}
The Document object you have at this point is a *new* Document object.
Therefore you will have to get the document element from that Document
object and set that as the SOAPEnvelope in the message context after
security processing. Calling doc.getDocumentElement() on the above
Document instance that you created will produce a org.w3c.dom.Element
that is also an axiom SOAPEnvelope.
HTH,
Thanks,
Ruchith
Ruchith has suggested to use Rampart. But now I do not really have time to
redesign and use Rampart. The only thing I need to sort out is how to make
the Axis2 SOAPEnvelope as convenient as Axis SOAPEnvelope.
I think this problem is quite common, has anyone already faced this problem?
Could you give some suggestion how to solve the problem?
Regards,
Xinjun
--
www.ruchith.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]