au.gov.nehta.vendorlibrary.ws.handler
Class LoggingHandler

java.lang.Object
  extended by au.gov.nehta.vendorlibrary.ws.handler.LoggingHandler
All Implemented Interfaces:
javax.xml.ws.handler.Handler<javax.xml.ws.handler.soap.SOAPMessageContext>, javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws.handler.soap.SOAPMessageContext>

public final class LoggingHandler
extends java.lang.Object
implements javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws.handler.soap.SOAPMessageContext>

This SOAP handler logs incoming and outgoing SOAP messages. If a SOAP handler is specified in the handler chain of a JAX-WS client or service, JAX-WS will call the SOAP handler before a SOAP message is sent (request) and after a SOAP message has been received (response).


Field Summary
static java.lang.String EMPTY
          Constant for empty string.
static java.lang.String ENCODING
          Character set encoding to use when serialising the SOAP XML.
 
Constructor Summary
LoggingHandler(boolean dump)
          Default constructor.
 
Method Summary
 void close(javax.xml.ws.handler.MessageContext context)
          Does nothing
Not utilised for dumping SOAP message.
 java.util.Set<javax.xml.namespace.QName> getHeaders()
          Ignore processing of SOAP header as the primary intention is just to 'Dump' the SOAP message.
 java.lang.String getLastSoapRequest()
          Getter for lastSoapRequest.
 java.lang.String getLastSoapResponse()
          Getter for lastSoapResponse.
 boolean handleFault(javax.xml.ws.handler.soap.SOAPMessageContext context)
          Logs outgoing and incoming faults.
 boolean handleMessage(javax.xml.ws.handler.soap.SOAPMessageContext context)
          Logs outgoing and incoming messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final java.lang.String EMPTY
Constant for empty string.

See Also:
Constant Field Values

ENCODING

public static final java.lang.String ENCODING
Character set encoding to use when serialising the SOAP XML.

See Also:
Constant Field Values
Constructor Detail

LoggingHandler

public LoggingHandler(boolean dump)
Default constructor.

Parameters:
dump - whether or not logging is required.
Method Detail

getLastSoapResponse

public java.lang.String getLastSoapResponse()
Getter for lastSoapResponse.

Returns:
lastSoapResponse the lastSoapResponse instance variable

getLastSoapRequest

public java.lang.String getLastSoapRequest()
Getter for lastSoapRequest.

Returns:
lastSoapRequest the lastSoapRequest instance variable (Mandatory)

handleMessage

public boolean handleMessage(javax.xml.ws.handler.soap.SOAPMessageContext context)
Logs outgoing and incoming messages.

Specified by:
handleMessage in interface javax.xml.ws.handler.Handler<javax.xml.ws.handler.soap.SOAPMessageContext>
Parameters:
context - The SOAP Message context.
Returns:
Boolean.TRUE handle message is successful else return FALSE
See Also:
Handler.handleMessage(javax.xml.ws.handler.MessageContext)

handleFault

public boolean handleFault(javax.xml.ws.handler.soap.SOAPMessageContext context)
Logs outgoing and incoming faults.

Specified by:
handleFault in interface javax.xml.ws.handler.Handler<javax.xml.ws.handler.soap.SOAPMessageContext>
Parameters:
context - the SOAP message context object to provide access to the SOAP message for either RPC request or response
Returns:
Boolean.TRUE if handleFault is successful, else returns Boolean.FALSE
See Also:
Handler.handleFault(javax.xml.ws.handler.MessageContext)

getHeaders

public java.util.Set<javax.xml.namespace.QName> getHeaders()
Ignore processing of SOAP header as the primary intention is just to 'Dump' the SOAP message.

Specified by:
getHeaders in interface javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws.handler.soap.SOAPMessageContext>
Returns:
Set the headers for this handler.
See Also:
SOAPHandler.getHeaders()

close

public void close(javax.xml.ws.handler.MessageContext context)
Does nothing
Not utilised for dumping SOAP message.

Specified by:
close in interface javax.xml.ws.handler.Handler<javax.xml.ws.handler.soap.SOAPMessageContext>
Parameters:
context - the SOAP Message context
See Also:
Handler.close(javax.xml.ws.handler.MessageContext)