org.nhindirect.xd.soap
Class DirectSOAPHandler

java.lang.Object
  extended by org.nhindirect.xd.soap.DirectSOAPHandler
All Implemented Interfaces:
Handler<SOAPMessageContext>, SOAPHandler<SOAPMessageContext>

public class DirectSOAPHandler
extends Object
implements SOAPHandler<SOAPMessageContext>

This class handles the SOAP-Requests before they reach the Web Service Operation. It is possible to read and manipulate the SOAP-Message.

Author:
Siegfried Bolz

Field Summary
protected  String action
           
protected  String directFrom
           
protected  String directMetadataLevel
           
protected  String directTo
           
protected  String endpoint
           
protected  String from
           
protected  String messageId
           
protected  String pid
           
protected  String relatesTo
           
protected  String remoteHost
           
protected  String thisHost
           
protected  String to
           
 
Constructor Summary
DirectSOAPHandler()
           
 
Method Summary
 void close(MessageContext messageContext)
           
 void destroy()
          Is executed before this handler is being destroyed - means after close() has been executed.
protected  void dumpSOAPMessage(SOAPMessage msg)
          Dump SOAP Message to console.
protected  void getHeaderData()
          Extract header values from a ThreadData object.
 Set<QName> getHeaders()
           
protected  String getMessageEncoding(SOAPMessage msg)
          Returns the message encoding (e.g.
 String getPID()
          Get the current process ID.
 boolean handleFault(SOAPMessageContext context)
           
 boolean handleMessage(SOAPMessageContext context)
          This method handles the incoming and outgoing SOAP-Message.
 void init()
          Is called after constructing the handler and before executing any othe method.
protected  void setHeaderData()
          Build a ThreadData object with header information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endpoint

protected String endpoint

messageId

protected String messageId

relatesTo

protected String relatesTo

action

protected String action

to

protected String to

remoteHost

protected String remoteHost

thisHost

protected String thisHost

pid

protected String pid

from

protected String from

directFrom

protected String directFrom

directTo

protected String directTo

directMetadataLevel

protected String directMetadataLevel
Constructor Detail

DirectSOAPHandler

public DirectSOAPHandler()
Method Detail

init

@PostConstruct
public void init()
Is called after constructing the handler and before executing any othe method.


close

public void close(MessageContext messageContext)
Specified by:
close in interface Handler<SOAPMessageContext>

destroy

@PreDestroy
public void destroy()
Is executed before this handler is being destroyed - means after close() has been executed.


handleMessage

public boolean handleMessage(SOAPMessageContext context)
This method handles the incoming and outgoing SOAP-Message. It's an excellent point to manipulate the SOAP.

Specified by:
handleMessage in interface Handler<SOAPMessageContext>
Parameters:
SOAPMessageContext - The SOAPMessageContext object.
Returns:
true for successful handling, false otherwise.

getHeaders

public Set<QName> getHeaders()
Specified by:
getHeaders in interface SOAPHandler<SOAPMessageContext>

getMessageEncoding

protected String getMessageEncoding(SOAPMessage msg)
                             throws SOAPException
Returns the message encoding (e.g. utf-8).

Parameters:
msg - The SOAPMessage object.
Returns:
the message encoding.
Throws:
SOAPException

dumpSOAPMessage

protected void dumpSOAPMessage(SOAPMessage msg)
Dump SOAP Message to console.

Parameters:
msg - The SOAPMessage object.

handleFault

public boolean handleFault(SOAPMessageContext context)
Specified by:
handleFault in interface Handler<SOAPMessageContext>

getHeaderData

protected void getHeaderData()
Extract header values from a ThreadData object.


setHeaderData

protected void setHeaderData()
Build a ThreadData object with header information.


getPID

public String getPID()
Get the current process ID.

Returns:
the current process ID


Copyright © 2010-2011. All Rights Reserved.