2 Replies Latest reply on Jan 18, 2008 6:23 PM by Alessio Soldano

    How can I see the SoapResponse

    Vincent Jassogne Newbie


      I generated a client with WSConsume and register a handler to log soap messages.

      The handler gets called and display the request but I am not able to see either the soapfault nor the soapresponse.

      Here is the code of my handler. Could you pls tell me what did I wrong ?

       final String HANDLER_NAME = "LogHandler";
       // change this to redirect output if desired
       private static PrintStream out = System.out;
       public boolean handleMessage(SOAPMessageContext smc) {
       System.out.println("Executing " + HANDLER_NAME);
       return false;
       public boolean handleFault(SOAPMessageContext smc) {
       System.out.println("Une faute");
       return false;
       // nothing to clean up
       public void close(MessageContext messageContext) {
       * Check the MESSAGE_OUTBOUND_PROPERTY in the context
       * to see if this is an outgoing or incoming message.
       * Write a brief message to the print stream and
       * output the message. The writeTo() method can throw
       * SOAPException or IOException
       private void logToSystemOut(SOAPMessageContext smc) {
       Boolean outboundProperty = (Boolean)
       if (outboundProperty) {
       out.println("\nOutbound message:");
       } else {
       out.println("\nInbound message:");
       SOAPMessage message = smc.getMessage();
       try {
       out.println(""); // just to add a newline
       } catch (Exception e) {
       out.println("Exception in handler: " + e);

      Thanks in advance