users@jax-ws.java.net

RE: Re: XWSS prints SOAP message

From: Erik Eriksson XB (TN/EAB) <"Erik>
Date: Fri, 15 Jun 2007 19:48:23 +0200

Ofcourse it was my dumpMessage that was set to true. Thanks for the
help!
 
/Erik

________________________________

From: Vbkumar.Jayanti_at_Sun.COM [mailto:Vbkumar.Jayanti_at_Sun.COM]
Sent: den 15 juni 2007 10:47
To: users_at_jax-ws.dev.java.net
Subject: Re: XWSS prints SOAP message


Erik Eriksson XB (TN/EAB) wrote:


        Hi,

        When I'm securing my message in my web service client with XWSS
it always System.out prints the SOAP message that I send and receive.
Can I somehow turn on and off this "feature"?

        Code snippet from a class that implements
SOAPHandler<SOAPMessageContext>:

        public boolean handleMessage(SOAPMessageContext context) {
                        
                        try {
                                XWSSProcessorFactory xwssProcFactory =
XWSSProcessorFactory.newInstance();
                                XWSSProcessor xwssProc =
xwssProcFactory.createProcessorForSecurityConfiguration(xwssInputStream,
null);

In your security configuration file there is an attribute called
dumpMessages. If it is set to true then it will print the messages. If
set to false it won't.

Eg. :

<xwss:SecurityConfiguration dumpMessages="false"
xmlns:xwss="http://java.sun.com/xml/ns/xwss/config"
<http://java.sun.com/xml/ns/xwss/config> >
    <xwss:Sign>
        <xwss:X509Token certificateAlias="xws-security-client"/>
    </xwss:Sign>
    <xwss:RequireSignature/>
</xwss:SecurityConfiguration>

The default value for dumpMessages is false. All our samples we set it
to true for illustration.

Thanks.




                                xwssInputStream.reset();
                                ProcessingContext procContext = new
ProcessingContext();
                                
        
procContext.setSOAPMessage(context.getMessage());

                                //secure the message.
        
xwssProc.secureOutboundMessage(procContext);
                        } catch (XWSSecurityException xwssE) {
                                System.err.println(xwssE.getMessage());
                        } catch (IOException e) {
                                System.err.println(e.getMessage());
                        }

                        return true;
                }

        Regards
        Erik Eriksson