com.infoengine.webject.msg
Class DefaultSOAPMessageHandler

java.lang.Object
  extended bycom.infoengine.webject.msg.DefaultSOAPMessageHandler
All Implemented Interfaces:
SOAPMessageHandler
Direct Known Subclasses:
DefaultSOAPDocumentHandler

public class DefaultSOAPMessageHandler
extends Object
implements SOAPMessageHandler

Note: when generating requests from GROUP_IN SOAP elements created from I*E Element data is NOT strongly typed (structures will not have a type attribute). I*E Element data found within an array (an Att containing multiple Element values) uses 'anyType' to describe the array contents/dimensions. This may be insufficient to generate very robust SOAP requests. In this case an additional SOAPMessageHandler may need to be implemented specifically to generate the required SOAP request OR as a future we may want to implement a metadata driven mechanism allowing callers to build complex I*E groups with metadata to allow strong typing of these unknown structures. Another related issue is the fact that, when using GROUP_IN, detection of embedded arrays relies on an attribute containing more than one value. Multi-valued atts are serialized as arrays, single valued atts are serialized as is (primitive, bean, Element struct). This results in no way to represent an array containing only one item... To work-around this issue metadata can be set on the Attribute in question. The metadata name is represented by the public static String META_ISARRAY available on this class. Setting this metadata (with any value) on the att will signal that it is to be serialized as an array. Primitive data types (java.lang. equivalents of things like int, float, double, java.util.Date, etc) will always be strongly typed.


Field Summary
protected  String endpoint
           
static String META_ISARRAY
           
protected  Operation operation
           
protected static String PARM_AUTHORIZATION
           
protected static String PARM_DBUSER
           
protected static String PARM_GROUPIN
           
protected static String PARM_GROUPOUT
           
protected static String PARM_OPERATION
           
protected static String PARM_PARAM
           
protected static String PARM_PASSWORD
           
protected static String PARM_PORT
           
protected static String PARM_SERVICE
           
protected static String PARM_WSDL
           
protected static String RESOURCE
           
protected  Task task
           
protected static String VALIDATE_OUT
           
protected  Webject w
           
protected static String WEBJECT
           
 
Constructor Summary
DefaultSOAPMessageHandler()
           
 
Method Summary
protected  void addRequestElement(javax.xml.soap.SOAPElement soapE, javax.xml.soap.SOAPMessage message, Element elem)
           
protected  void buildRequestFromGroup(javax.xml.soap.SOAPElement request, javax.xml.soap.SOAPMessage message, Group group)
           
protected  Group buildResponseGroup(String grout, javax.xml.soap.SOAPElement responseElement, Message output, javax.xml.soap.SOAPMessage response)
           
protected  Group buildUnvalidatedResponseGroup(String grout, javax.xml.soap.SOAPElement responseElement, javax.xml.soap.SOAPMessage response)
           
protected  Group buildValidatedResponseGroup(String grout, javax.xml.soap.SOAPElement responseElement, Message output, javax.xml.soap.SOAPMessage response)
           
protected  Element createIEElement(SchemaElement schema, javax.xml.soap.SOAPElement sElement)
           
protected  Element createUnvalidatedElement(javax.xml.soap.SOAPElement e, javax.xml.soap.SOAPEnvelope envelope, javax.xml.soap.SOAPBody body)
           
protected  javax.xml.soap.SOAPElement firstSOAPElement(javax.xml.soap.SOAPElement e)
           
protected  javax.xml.soap.SOAPElement followHref(javax.xml.soap.SOAPElement e, javax.xml.soap.SOAPEnvelope env, javax.xml.soap.SOAPBody body)
           
 javax.xml.soap.SOAPMessage generateRequest(Task task)
           
 URL getURLEndpoint()
           
protected  Object getValue(javax.xml.soap.SOAPElement e)
           
protected  boolean hasSubElements(javax.xml.soap.SOAPElement e)
           
protected  boolean isArray(javax.xml.soap.SOAPElement e)
           
protected  javax.xml.soap.SOAPElement nextSOAPElement(Iterator iter)
           
 Task processResponse(javax.xml.soap.SOAPMessage response)
           
protected  Object recastObject(int type, Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARM_WSDL

protected static final String PARM_WSDL
See Also:
Constant Field Values

PARM_OPERATION

protected static final String PARM_OPERATION
See Also:
Constant Field Values

PARM_GROUPOUT

protected static final String PARM_GROUPOUT
See Also:
Constant Field Values

PARM_GROUPIN

protected static final String PARM_GROUPIN
See Also:
Constant Field Values

PARM_SERVICE

protected static final String PARM_SERVICE
See Also:
Constant Field Values

PARM_PORT

protected static final String PARM_PORT
See Also:
Constant Field Values

PARM_PARAM

protected static final String PARM_PARAM
See Also:
Constant Field Values

VALIDATE_OUT

protected static final String VALIDATE_OUT
See Also:
Constant Field Values

PARM_DBUSER

protected static final String PARM_DBUSER
See Also:
Constant Field Values

PARM_PASSWORD

protected static final String PARM_PASSWORD
See Also:
Constant Field Values

PARM_AUTHORIZATION

protected static final String PARM_AUTHORIZATION
See Also:
Constant Field Values

RESOURCE

protected static final String RESOURCE
See Also:
Constant Field Values

WEBJECT

protected static final String WEBJECT
See Also:
Constant Field Values

META_ISARRAY

public static final String META_ISARRAY
See Also:
Constant Field Values

task

protected Task task

w

protected Webject w

operation

protected Operation operation

endpoint

protected String endpoint
Constructor Detail

DefaultSOAPMessageHandler

public DefaultSOAPMessageHandler()
Method Detail

generateRequest

public javax.xml.soap.SOAPMessage generateRequest(Task task)
                                           throws Exception
Specified by:
generateRequest in interface SOAPMessageHandler
Throws:
Exception

getURLEndpoint

public URL getURLEndpoint()
Specified by:
getURLEndpoint in interface SOAPMessageHandler

processResponse

public Task processResponse(javax.xml.soap.SOAPMessage response)
                     throws Exception
Specified by:
processResponse in interface SOAPMessageHandler
Throws:
Exception

buildRequestFromGroup

protected void buildRequestFromGroup(javax.xml.soap.SOAPElement request,
                                     javax.xml.soap.SOAPMessage message,
                                     Group group)
                              throws Exception
Throws:
Exception

addRequestElement

protected void addRequestElement(javax.xml.soap.SOAPElement soapE,
                                 javax.xml.soap.SOAPMessage message,
                                 Element elem)
                          throws Exception
Throws:
Exception

recastObject

protected Object recastObject(int type,
                              Object o)

nextSOAPElement

protected javax.xml.soap.SOAPElement nextSOAPElement(Iterator iter)

followHref

protected javax.xml.soap.SOAPElement followHref(javax.xml.soap.SOAPElement e,
                                                javax.xml.soap.SOAPEnvelope env,
                                                javax.xml.soap.SOAPBody body)
                                         throws Exception
Throws:
Exception

firstSOAPElement

protected javax.xml.soap.SOAPElement firstSOAPElement(javax.xml.soap.SOAPElement e)

hasSubElements

protected boolean hasSubElements(javax.xml.soap.SOAPElement e)

isArray

protected boolean isArray(javax.xml.soap.SOAPElement e)
                   throws Exception
Throws:
Exception

getValue

protected Object getValue(javax.xml.soap.SOAPElement e)
                   throws Exception
Throws:
Exception

buildResponseGroup

protected Group buildResponseGroup(String grout,
                                   javax.xml.soap.SOAPElement responseElement,
                                   Message output,
                                   javax.xml.soap.SOAPMessage response)
                            throws Exception
Throws:
Exception

createUnvalidatedElement

protected Element createUnvalidatedElement(javax.xml.soap.SOAPElement e,
                                           javax.xml.soap.SOAPEnvelope envelope,
                                           javax.xml.soap.SOAPBody body)
                                    throws Exception
Throws:
Exception

buildUnvalidatedResponseGroup

protected Group buildUnvalidatedResponseGroup(String grout,
                                              javax.xml.soap.SOAPElement responseElement,
                                              javax.xml.soap.SOAPMessage response)
                                       throws Exception
Throws:
Exception

buildValidatedResponseGroup

protected Group buildValidatedResponseGroup(String grout,
                                            javax.xml.soap.SOAPElement responseElement,
                                            Message output,
                                            javax.xml.soap.SOAPMessage response)
                                     throws Exception
Throws:
Exception

createIEElement

protected Element createIEElement(SchemaElement schema,
                                  javax.xml.soap.SOAPElement sElement)
                           throws Exception
Throws:
Exception