com.infoengine.soap.util
Class IESOAPUtils

java.lang.Object
  extended bycom.infoengine.soap.util.IESOAPUtils

public class IESOAPUtils
extends Object

IMPORTANT: this should be the only class within the com.infoengine.soap.util package that has Info*Engine dependancies.


Nested Class Summary
(package private)  class IESOAPUtils.MaxInputStream
          InputStream class that will return eof when a specified number of bytes have been read This is necessary when connection pooling is used to avoid hangs when SAAJ classes attempt to read beyond Content-Length bytes.
 
Field Summary
private static String RESOURCE
           
private static IESOAPUtils SINGLETON
           
private static String xmlHeader
           
 
Constructor Summary
IESOAPUtils()
           
 
Method Summary
private static Object _generateIEReturn(IeCollection vdb, int sType, String subsStr)
          Handles the INFOENGINE_* response types.
static javax.xml.soap.SOAPMessage _generateResponse(String methodName, IeCollection vdb, boolean renderMeta, OutputStream attachmentOS, OutputStream stream)
           
private static Object _generateReturn(IeCollection vdb, String retType, String subsStr, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Generate the SOAP return value from a vdb.
private static void addLightweightValue(Attribute att, Object o)
          Adds a value to an attribute.
static void addMeta(IeObject ieobj, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          If available adds meta information to a parent SOAP element.
static void attributeToElement(Att att, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Turns an I*E attribute into a SOAPElement.
static void attributeToElement(Att att, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message, String eName, boolean type, boolean qualify)
          Turns an I*E attribute into a SOAPElement.
private static void badSubstitution(String subsStr)
          Convenience method that just throws an IEFatalException with the input.
private static String checkPolymorphic(javax.xml.soap.SOAPElement[] elms, String retType)
          Searches a list of SOAP elements to see if they are of mixed type.
static void collectionToElement(IeCollection col, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Turns an I*E collection into a SOAPElement.
static void collectionToElement(IeCollection col, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message, String eName, boolean type, boolean qualify)
          Turns an I*E collection into a SOAPElement.
static Object deserialize(javax.xml.soap.SOAPMessage message)
          Deserialize a SOAPMessage into an appropriate java Object.
static Att elementToAttribute(javax.xml.soap.SOAPElement elm, javax.xml.soap.SOAPMessage message)
          Turns a SOAPElement representing an I*E attribute back into a attribute.
static IeCollection elementToCollection(javax.xml.soap.SOAPElement elm, javax.xml.soap.SOAPMessage message)
          Turns a SOAPElement representing an I*E collection back into a collection.
static void elementToElement(Element elem, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Turns an I*E element into a SOAPElement.
static void elementToElement(Element elem, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message, String eName, boolean type, boolean qualify)
          Turns an I*E element into a SOAPElement.
static Element elementToElement(javax.xml.soap.SOAPElement elm, javax.xml.soap.SOAPMessage message)
          Turns a SOAPElement representing an I*E element back into a element.
static Group elementToGroup(javax.xml.soap.SOAPElement elm, javax.xml.soap.SOAPMessage message)
          Turns a SOAPElement representing an I*E group back into a group.
static Object elementToObject(javax.xml.soap.SOAPElement element, javax.xml.soap.SOAPMessage message)
          Turns a SOAPElement back into a java object.
(package private) static Object elementToObject(javax.xml.soap.SOAPElement element, javax.xml.soap.SOAPMessage message, SOAPUtils.ArrayHandler arrayHandler)
          Same as public elementToObject method except passes a long an ArrayHandler.
static IeRequest elementToRequest(javax.xml.soap.SOAPElement elm, javax.xml.soap.SOAPMessage message)
          Turns a SOAPElement representing an I*E request back into a request.
static int fault(int httpR, Throwable t, OutputStream out)
          Generates a SOAP fault and serializes it to an output stream.
private static javax.xml.soap.SOAPMessage fault(Throwable t, int httpR)
          Generates a SOAP fault from an exception and an HTTP response code.
static int fault(Throwable t, OutputStream out)
          Generates a SOAP fault and serializes the resulting SOAP message to an output stream.
private static String faultCode(int httpResp)
          Turns an HTTP response code into a SOAP fault code string.
static javax.xml.soap.SOAPMessage generateRequest(Hashtable headers, InputStream is)
          Generates a SOAPMessage from a set of MIME headers and an InputStream.
static javax.xml.soap.SOAPMessage generateRequest(javax.xml.soap.MimeHeaders headers, InputStream in)
          Generates a SOAPMessage from a set of MIME headers and an InputStream.
static javax.xml.soap.SOAPMessage generateResponse(String methodName, IeCollection vdb, boolean renderMeta, OutputStream attachmentOS)
          Generates a SOAP response based on some I*E stuff.
static Hashtable generateResponse(String methodName, IeCollection vdb, boolean renderMeta, OutputStream attachment, OutputStream out)
          Generates a SOAP response based on input and serializes it to an output stream.
static Object generateReturn(IeCollection vdb, String retType, String subsStr, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Generate the SOAP return value from a vdb.
static javax.xml.soap.SOAPMessage generateSAXRequest(Hashtable headers, InputStream is)
          Generates a SOAPMessage from a set of MIME headers and an InputStream using SAX.
static void getMeta(IeObject ieobj, javax.xml.soap.SOAPElement elm, javax.xml.soap.SOAPMessage message)
          Repopulates meta data on an I*E object from a SOAP element.
private static Object getReturn(int type, String retType, Object o, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message, boolean arry)
          Performs actual recasting of object types from I*E data.
static void groupToElement(Group g, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Turns an I*E group into a SOAPElement.
static void groupToElement(Group g, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message, String eName, boolean type, boolean qualify)
          Turns an I*E group into a SOAPElement.
static int httpResponse(Throwable t)
          Gets an HTTP response code equivalent to a specific exception.
static Attribute lightweight(Att a)
          Turns a heavy I*E attribute into a lightweight one.
static Element lightweight(Element e)
          Turns a heavy I*E element into a lightweight one.
static Group lightweight(Group g)
          Turns a heavy I*E group into a lightweight one.
static Collection lightweight(IeCollection col)
          Turns a heavy I*E collection into a lightweight one.
private static void lightweightMeta(Data d, IeObject o)
          Copies meta from a heavy I*E data structure into its lightweight counterpart.
static void lookForVME(Throwable t)
           
static void objectToElement(String eName, Object object, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Turns a java object into a SOAP element.
private static Object populateBean(String beanClass, Element elem, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Populates a java bean object from an I*E element.
static void requestToElement(IeRequest request, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message)
          Turns an I*E request into a SOAPElement.
private static javax.xml.soap.SOAPElement serializeIEDataArray(String eName, int type, Object[] objects, javax.xml.soap.SOAPElement parent, javax.xml.soap.SOAPMessage message, String arrayMemberName)
          Used internally to serialize arrays of I*E data structure objects.
static Throwable unwrap(Throwable t)
          Unwraps nested throwables from within a throwable to get to the root of the problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

xmlHeader

private static final String xmlHeader
See Also:
Constant Field Values

SINGLETON

private static IESOAPUtils SINGLETON
Constructor Detail

IESOAPUtils

public IESOAPUtils()
Method Detail

unwrap

public static Throwable unwrap(Throwable t)
Unwraps nested throwables from within a throwable to get to the root of the problem. The following exception types will cause unwrapping.

Parameters:
t - The throwable to unwrap.
Returns:
The result of unwrapping.

faultCode

private static String faultCode(int httpResp)
Turns an HTTP response code into a SOAP fault code string.

Parameters:
httpResp - The HTTP response code.
Returns:
The closest equivalent SOAP fault code string.

httpResponse

public static int httpResponse(Throwable t)
Gets an HTTP response code equivalent to a specific exception. For example IEBadRequestException == 400 (HTTP_BAD_REQUEST).

Parameters:
t - The throwable object to examine.
Returns:
The close HTTP response code.

fault

private static javax.xml.soap.SOAPMessage fault(Throwable t,
                                                int httpR)
                                         throws javax.xml.soap.SOAPException
Generates a SOAP fault from an exception and an HTTP response code.

Parameters:
t - The throwable.
httpR - The HTTP response code.
Returns:
The resulting SOAP message containing a fault object.
Throws:
javax.xml.soap.SOAPException

fault

public static int fault(Throwable t,
                        OutputStream out)
Generates a SOAP fault and serializes the resulting SOAP message to an output stream. The contents of the SOAP fault are based on t.

Parameters:
t - The exception.
out - The OutputStream to stream generated SOAPFault to.
Returns:
The resulting HTTP response code.

fault

public static int fault(int httpR,
                        Throwable t,
                        OutputStream out)
Generates a SOAP fault and serializes it to an output stream. Allows the client to decide on the HTTP response, given an OutputStream generate a SOAPFault and stream it to out.

Parameters:
httpR - The HTTP response code.
t - The exception.
out - The OutputStream to stream generated SOAPFault to.
Returns:
The resulting HTTP response code.

generateRequest

public static javax.xml.soap.SOAPMessage generateRequest(Hashtable headers,
                                                         InputStream is)
                                                  throws IOException,
                                                         javax.xml.soap.SOAPException
Generates a SOAPMessage from a set of MIME headers and an InputStream.

Parameters:
headers - The MIME headers, key=header name, value=header value.
is - The input stream contain the SOAP.
Returns:
The resulting SOAPMessage object.
Throws:
IOException
javax.xml.soap.SOAPException

generateSAXRequest

public static javax.xml.soap.SOAPMessage generateSAXRequest(Hashtable headers,
                                                            InputStream is)
                                                     throws IOException,
                                                            javax.xml.soap.SOAPException
Generates a SOAPMessage from a set of MIME headers and an InputStream using SAX.

Parameters:
headers - The MIME headers, key=header name, value=header value.
is - The input stream contain the SOAP.
Returns:
The resulting SOAPMessage object.
Throws:
IOException
javax.xml.soap.SOAPException

generateRequest

public static javax.xml.soap.SOAPMessage generateRequest(javax.xml.soap.MimeHeaders headers,
                                                         InputStream in)
                                                  throws IOException,
                                                         javax.xml.soap.SOAPException
Generates a SOAPMessage from a set of MIME headers and an InputStream.

Parameters:
headers - The MIME headers.
Returns:
The resulting SOAPMessage object.
Throws:
IOException
javax.xml.soap.SOAPException

generateResponse

public static Hashtable generateResponse(String methodName,
                                         IeCollection vdb,
                                         boolean renderMeta,
                                         OutputStream attachment,
                                         OutputStream out)
Generates a SOAP response based on input and serializes it to an output stream. Clients may use this method to create an Info*Engine SOAP response. The results will be a SOAPMessage serialized to the output stream. If an error occurs a SOAPMessage containing a SOAPFault will be serialized to the output stream.

Parameters:
methodName - The method name that was invoked.
vdb - The I*E collection result.
renderMeta - Should I*E meta info be generated when the result is tunnelled I*E XML.
attachment - An optional attachment (causes empty response).
out - The output stream to serialize the response to.
Returns:
Resulting MIME headers.

checkPolymorphic

private static String checkPolymorphic(javax.xml.soap.SOAPElement[] elms,
                                       String retType)
Searches a list of SOAP elements to see if they are of mixed type. Check the "type" attributes of all elms, if not mixed remove all type attributes.

Parameters:
elms - The list of elements to search.
Returns:
An array def, anyType if mixed types.

generateResponse

public static javax.xml.soap.SOAPMessage generateResponse(String methodName,
                                                          IeCollection vdb,
                                                          boolean renderMeta,
                                                          OutputStream attachmentOS)
                                                   throws ClassNotFoundException,
                                                          InstantiationException,
                                                          IllegalAccessException,
                                                          NotSerializableException,
                                                          IllegalArgumentException,
                                                          IntrospectionException,
                                                          InvocationTargetException,
                                                          javax.xml.soap.SOAPException,
                                                          IOException,
                                                          IEException
Generates a SOAP response based on some I*E stuff. Left public in case someone needs to do something more powerful and clients need to catch exceptions and should call IESOAPUtil.fault to generate a fault from the exception. Probably clients should use the generateResponse method that takes an OutputStream and has a Hashtable return value.

Parameters:
methodName - The method name that was invoked.
vdb - The I*E collection result.
renderMeta - Should I*E meta info be generated when the result is tunnelled I*E XML.
attachmentOS - An optional SOAP attachment.
Returns:
Resulting SOAPMessage object.
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IllegalArgumentException
IntrospectionException
InvocationTargetException
javax.xml.soap.SOAPException
IOException
IEException

_generateResponse

public static javax.xml.soap.SOAPMessage _generateResponse(String methodName,
                                                           IeCollection vdb,
                                                           boolean renderMeta,
                                                           OutputStream attachmentOS,
                                                           OutputStream stream)
                                                    throws ClassNotFoundException,
                                                           InstantiationException,
                                                           IllegalAccessException,
                                                           NotSerializableException,
                                                           IllegalArgumentException,
                                                           IntrospectionException,
                                                           InvocationTargetException,
                                                           javax.xml.soap.SOAPException,
                                                           IOException,
                                                           IEException
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IllegalArgumentException
IntrospectionException
InvocationTargetException
javax.xml.soap.SOAPException
IOException
IEException

badSubstitution

private static void badSubstitution(String subsStr)
                             throws IEFatalException
Convenience method that just throws an IEFatalException with the input.

Parameters:
subsStr - The substitution string.
Throws:
IEFatalException - (always)

generateReturn

public static Object generateReturn(IeCollection vdb,
                                    String retType,
                                    String subsStr,
                                    javax.xml.soap.SOAPElement parent,
                                    javax.xml.soap.SOAPMessage message)
                             throws ClassNotFoundException,
                                    InstantiationException,
                                    IllegalAccessException,
                                    NotSerializableException,
                                    IllegalArgumentException,
                                    IntrospectionException,
                                    InvocationTargetException,
                                    javax.xml.soap.SOAPException,
                                    IEException
Generate the SOAP return value from a vdb. Called as a result of a task containing an @return in its SOAP comments block.

Parameters:
vdb - The VDB following task execution
retType - The string representation of the return type (primitive or bean)
Returns:
A primitive java object or bean or maybe I*E data.
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IllegalArgumentException
IntrospectionException
InvocationTargetException
javax.xml.soap.SOAPException
IEException

_generateIEReturn

private static Object _generateIEReturn(IeCollection vdb,
                                        int sType,
                                        String subsStr)
                                 throws IEFatalException
Handles the INFOENGINE_* response types.

Parameters:
vdb - The I*E VDB.
sType - The SOAP type (must be INFOENGINE_* type).
Returns:
A heavy I*E data object.
Throws:
IEFatalException

_generateReturn

private static Object _generateReturn(IeCollection vdb,
                                      String retType,
                                      String subsStr,
                                      javax.xml.soap.SOAPElement parent,
                                      javax.xml.soap.SOAPMessage message)
                               throws ClassNotFoundException,
                                      InstantiationException,
                                      IllegalAccessException,
                                      NotSerializableException,
                                      IllegalArgumentException,
                                      IntrospectionException,
                                      InvocationTargetException,
                                      javax.xml.soap.SOAPException,
                                      IEException
Generate the SOAP return value from a vdb.

Parameters:
vdb - The VDB following task execution
retType - The string representation of the return type (primitive or bean)
message - The associated SOAP message.
Returns:
A primitive java object or bean or maybe I*E data.
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IllegalArgumentException
IntrospectionException
InvocationTargetException
javax.xml.soap.SOAPException
IEException

getReturn

private static Object getReturn(int type,
                                String retType,
                                Object o,
                                javax.xml.soap.SOAPElement parent,
                                javax.xml.soap.SOAPMessage message,
                                boolean arry)
                         throws ClassNotFoundException,
                                InstantiationException,
                                IllegalAccessException,
                                NotSerializableException,
                                IllegalArgumentException,
                                IntrospectionException,
                                InvocationTargetException,
                                IEException,
                                javax.xml.soap.SOAPException
Performs actual recasting of object types from I*E data. Invoked following processing of substitution syntax when an object has been resolved.

Parameters:
type - The object type.
retType - The return type string.
o - The resolved object.
message - The associated SOAP message.
arry - Is this call part of array construction?
Returns:
The recast object (if SOAPElementHandler will be SOAPElement object).
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IllegalArgumentException
IntrospectionException
InvocationTargetException
IEException
javax.xml.soap.SOAPException

populateBean

private static Object populateBean(String beanClass,
                                   Element elem,
                                   javax.xml.soap.SOAPElement parent,
                                   javax.xml.soap.SOAPMessage message)
                            throws ClassNotFoundException,
                                   InstantiationException,
                                   IllegalAccessException,
                                   NotSerializableException,
                                   IntrospectionException,
                                   InvocationTargetException,
                                   IEException,
                                   javax.xml.soap.SOAPException
Populates a java bean object from an I*E element. Bean utility method specified here to make BeanUtils class more portable not requiring Info*Engine classes.

Parameters:
beanClass - The class name of the bean to populate.
elem - The I*E element object to populate from.
message - The associated SOAP message.
Returns:
The populated java bean.
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IntrospectionException
InvocationTargetException
IEException
javax.xml.soap.SOAPException

requestToElement

public static void requestToElement(IeRequest request,
                                    javax.xml.soap.SOAPElement parent,
                                    javax.xml.soap.SOAPMessage message)
                             throws javax.xml.soap.SOAPException,
                                    ClassNotFoundException,
                                    IllegalAccessException,
                                    InstantiationException,
                                    InvocationTargetException,
                                    NotSerializableException,
                                    IntrospectionException
Turns an I*E request into a SOAPElement.

Parameters:
request - The request.
parent - The parent element to add the collection to.
message - The associated SOAP message.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

collectionToElement

public static void collectionToElement(IeCollection col,
                                       javax.xml.soap.SOAPElement parent,
                                       javax.xml.soap.SOAPMessage message)
                                throws javax.xml.soap.SOAPException,
                                       ClassNotFoundException,
                                       IllegalAccessException,
                                       InstantiationException,
                                       InvocationTargetException,
                                       NotSerializableException,
                                       IntrospectionException
Turns an I*E collection into a SOAPElement.

Parameters:
col - The collection.
parent - The parent element to add the collection to.
message - The associated SOAP message.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

collectionToElement

public static void collectionToElement(IeCollection col,
                                       javax.xml.soap.SOAPElement parent,
                                       javax.xml.soap.SOAPMessage message,
                                       String eName,
                                       boolean type,
                                       boolean qualify)
                                throws javax.xml.soap.SOAPException,
                                       ClassNotFoundException,
                                       IllegalAccessException,
                                       InstantiationException,
                                       InvocationTargetException,
                                       NotSerializableException,
                                       IntrospectionException
Turns an I*E collection into a SOAPElement.

Parameters:
col - The collection.
parent - The parent element to add the collection to.
message - The associated SOAP message.
eName - The element name to create.
type - Should the element be typed?
qualify - Should the element be qualified?
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

groupToElement

public static void groupToElement(Group g,
                                  javax.xml.soap.SOAPElement parent,
                                  javax.xml.soap.SOAPMessage message)
                           throws javax.xml.soap.SOAPException,
                                  ClassNotFoundException,
                                  IllegalAccessException,
                                  InstantiationException,
                                  InvocationTargetException,
                                  NotSerializableException,
                                  IntrospectionException
Turns an I*E group into a SOAPElement.

Parameters:
g - The Group.
parent - The parent element to add the group to.
message - The associated SOAP message.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

groupToElement

public static void groupToElement(Group g,
                                  javax.xml.soap.SOAPElement parent,
                                  javax.xml.soap.SOAPMessage message,
                                  String eName,
                                  boolean type,
                                  boolean qualify)
                           throws javax.xml.soap.SOAPException,
                                  ClassNotFoundException,
                                  IllegalAccessException,
                                  InstantiationException,
                                  InvocationTargetException,
                                  NotSerializableException,
                                  IntrospectionException
Turns an I*E group into a SOAPElement.

Parameters:
g - The Group.
parent - The parent element to add the group to.
message - The associated SOAP message.
eName - The element name to create.
type - Should the element be typed?
qualify - Should the element be qualified?
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

elementToElement

public static void elementToElement(Element elem,
                                    javax.xml.soap.SOAPElement parent,
                                    javax.xml.soap.SOAPMessage message)
                             throws javax.xml.soap.SOAPException,
                                    ClassNotFoundException,
                                    IllegalAccessException,
                                    InstantiationException,
                                    InvocationTargetException,
                                    NotSerializableException,
                                    IntrospectionException
Turns an I*E element into a SOAPElement.

Parameters:
elem - The element.
parent - The parent element to add the element to.
message - The associated SOAP message.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

elementToElement

public static void elementToElement(Element elem,
                                    javax.xml.soap.SOAPElement parent,
                                    javax.xml.soap.SOAPMessage message,
                                    String eName,
                                    boolean type,
                                    boolean qualify)
                             throws javax.xml.soap.SOAPException,
                                    ClassNotFoundException,
                                    IllegalAccessException,
                                    InstantiationException,
                                    InvocationTargetException,
                                    NotSerializableException,
                                    IntrospectionException
Turns an I*E element into a SOAPElement.

Parameters:
elem - The element.
parent - The parent element to add the element to.
message - The associated SOAP message.
eName - The element name to create.
type - Should the element be typed?
qualify - Should the element be qualified?
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

attributeToElement

public static void attributeToElement(Att att,
                                      javax.xml.soap.SOAPElement parent,
                                      javax.xml.soap.SOAPMessage message)
                               throws javax.xml.soap.SOAPException,
                                      ClassNotFoundException,
                                      IllegalAccessException,
                                      InstantiationException,
                                      InvocationTargetException,
                                      NotSerializableException,
                                      IntrospectionException
Turns an I*E attribute into a SOAPElement. Assumes multi-valued attributes are NOT polymorphic.

Parameters:
att - The attribute.
parent - The parent element to add the attribute to.
message - The associated SOAP message.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

attributeToElement

public static void attributeToElement(Att att,
                                      javax.xml.soap.SOAPElement parent,
                                      javax.xml.soap.SOAPMessage message,
                                      String eName,
                                      boolean type,
                                      boolean qualify)
                               throws javax.xml.soap.SOAPException,
                                      ClassNotFoundException,
                                      IllegalAccessException,
                                      InstantiationException,
                                      InvocationTargetException,
                                      NotSerializableException,
                                      IntrospectionException
Turns an I*E attribute into a SOAPElement. Assumes multi-valued attributes are NOT polymorphic.

Parameters:
att - The attribute.
parent - The parent element to add the attribute to.
message - The associated SOAP message.
eName - The element name to create.
type - Should the element be typed?
qualify - Should the element be qualified?
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

addMeta

public static void addMeta(IeObject ieobj,
                           javax.xml.soap.SOAPElement parent,
                           javax.xml.soap.SOAPMessage message)
                    throws javax.xml.soap.SOAPException,
                           ClassNotFoundException,
                           IllegalAccessException,
                           InstantiationException,
                           InvocationTargetException,
                           NotSerializableException,
                           IntrospectionException
If available adds meta information to a parent SOAP element.

Parameters:
ieobj - The I*E object.
parent - The parent SOAP element.
message - The associated SOAP message.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

elementToRequest

public static IeRequest elementToRequest(javax.xml.soap.SOAPElement elm,
                                         javax.xml.soap.SOAPMessage message)
                                  throws javax.xml.soap.SOAPException,
                                         ClassNotFoundException,
                                         IllegalAccessException,
                                         InstantiationException,
                                         InvocationTargetException,
                                         NotSerializableException,
                                         IntrospectionException
Turns a SOAPElement representing an I*E request back into a request.

Parameters:
elm - The SOAP element.
message - The associated SOAP message.
Returns:
The deserialized request.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

elementToCollection

public static IeCollection elementToCollection(javax.xml.soap.SOAPElement elm,
                                               javax.xml.soap.SOAPMessage message)
                                        throws javax.xml.soap.SOAPException,
                                               ClassNotFoundException,
                                               IllegalAccessException,
                                               InstantiationException,
                                               InvocationTargetException,
                                               NotSerializableException,
                                               IntrospectionException
Turns a SOAPElement representing an I*E collection back into a collection.

Parameters:
elm - The SOAP element.
message - The associated SOAP message.
Returns:
The deserialized collection.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

elementToGroup

public static Group elementToGroup(javax.xml.soap.SOAPElement elm,
                                   javax.xml.soap.SOAPMessage message)
                            throws javax.xml.soap.SOAPException,
                                   ClassNotFoundException,
                                   IllegalAccessException,
                                   InstantiationException,
                                   InvocationTargetException,
                                   NotSerializableException,
                                   IntrospectionException
Turns a SOAPElement representing an I*E group back into a group.

Parameters:
elm - The SOAP element.
message - The associated SOAP message.
Returns:
The deserialized group.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

elementToElement

public static Element elementToElement(javax.xml.soap.SOAPElement elm,
                                       javax.xml.soap.SOAPMessage message)
                                throws javax.xml.soap.SOAPException,
                                       ClassNotFoundException,
                                       IllegalAccessException,
                                       InstantiationException,
                                       InvocationTargetException,
                                       NotSerializableException,
                                       IntrospectionException
Turns a SOAPElement representing an I*E element back into a element. Odd overload.

Parameters:
elm - The SOAP element.
message - The associated SOAP message.
Returns:
The deserialized element.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

elementToAttribute

public static Att elementToAttribute(javax.xml.soap.SOAPElement elm,
                                     javax.xml.soap.SOAPMessage message)
                              throws javax.xml.soap.SOAPException,
                                     ClassNotFoundException,
                                     IllegalAccessException,
                                     InstantiationException,
                                     InvocationTargetException,
                                     NotSerializableException,
                                     IntrospectionException
Turns a SOAPElement representing an I*E attribute back into a attribute.

Parameters:
elm - The SOAP element.
message - The associated SOAP message.
Returns:
The deserialized attribute.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

getMeta

public static void getMeta(IeObject ieobj,
                           javax.xml.soap.SOAPElement elm,
                           javax.xml.soap.SOAPMessage message)
                    throws javax.xml.soap.SOAPException,
                           ClassNotFoundException,
                           IllegalAccessException,
                           InstantiationException,
                           InvocationTargetException,
                           NotSerializableException,
                           IntrospectionException
Repopulates meta data on an I*E object from a SOAP element.

Parameters:
ieobj - The I*E data object to put meta back into.
elm - The SOAP element.
message - The associated SOAP message.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
NotSerializableException
IntrospectionException

lightweight

public static Collection lightweight(IeCollection col)
Turns a heavy I*E collection into a lightweight one.

Parameters:
col - The heavy collection.
Returns:
The lightweight equivalent.

lightweight

public static Group lightweight(Group g)
Turns a heavy I*E group into a lightweight one.

Parameters:
g - The heavy group.
Returns:
The lightweight equivalent.

lightweight

public static Element lightweight(Element e)
Turns a heavy I*E element into a lightweight one.

Parameters:
e - The heavy element.
Returns:
The lightweight equivalent.

lightweight

public static Attribute lightweight(Att a)
Turns a heavy I*E attribute into a lightweight one.

Parameters:
a - The heavy attribute.
Returns:
The lightweight equivalent.

addLightweightValue

private static void addLightweightValue(Attribute att,
                                        Object o)
Adds a value to an attribute. Deals with nested heavy data structures.

Parameters:
att - The lightweight att to add the value to.
o - The object.

lightweightMeta

private static void lightweightMeta(Data d,
                                    IeObject o)
Copies meta from a heavy I*E data structure into its lightweight counterpart.

Parameters:
d - The lightweight structure.
o - The heavy structure.

deserialize

public static Object deserialize(javax.xml.soap.SOAPMessage message)
                          throws ClassNotFoundException,
                                 InstantiationException,
                                 IllegalAccessException,
                                 NotSerializableException,
                                 IllegalArgumentException,
                                 IntrospectionException,
                                 InvocationTargetException,
                                 javax.xml.soap.SOAPException
Deserialize a SOAPMessage into an appropriate java Object. results may be:
java object or object representation of primitive
java bean
array of java object or object representation of primitive
array of java bean

Parameters:
message - The SOAPMessage to deserialize.
Returns:
Object the object reconstructed from message.
Throws:
javax.xml.soap.SOAPException - if the message contains a Fault.
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IllegalArgumentException
IntrospectionException
InvocationTargetException

elementToObject

public static Object elementToObject(javax.xml.soap.SOAPElement element,
                                     javax.xml.soap.SOAPMessage message)
                              throws ClassNotFoundException,
                                     InstantiationException,
                                     IllegalAccessException,
                                     NotSerializableException,
                                     IllegalArgumentException,
                                     IntrospectionException,
                                     InvocationTargetException,
                                     javax.xml.soap.SOAPException
Turns a SOAPElement back into a java object. If the SOAPElement is strongly typed then the return object will be of the type (if supported). beans and arrays of primitives or beans are supported. This method exists to optimize creation of heave I*E data structures on the server side. This avoids creation of a lightweight version of the data and then translation of that object into a heavy version. If the type is not an I*E data type then this method defers to the I*E independant SOAPUtils.elementToObject method (which would have returned lightweight versions of the data structures.

Parameters:
element - - the element to return to a java object
message - The associated SOAP message.
Returns:
a recast object or String if not strongly typed.
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IllegalArgumentException
IntrospectionException
InvocationTargetException
javax.xml.soap.SOAPException

elementToObject

static Object elementToObject(javax.xml.soap.SOAPElement element,
                              javax.xml.soap.SOAPMessage message,
                              SOAPUtils.ArrayHandler arrayHandler)
                       throws ClassNotFoundException,
                              InstantiationException,
                              IllegalAccessException,
                              NotSerializableException,
                              IllegalArgumentException,
                              IntrospectionException,
                              InvocationTargetException,
                              javax.xml.soap.SOAPException
Same as public elementToObject method except passes a long an ArrayHandler.

Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IllegalArgumentException
IntrospectionException
InvocationTargetException
javax.xml.soap.SOAPException

objectToElement

public static void objectToElement(String eName,
                                   Object object,
                                   javax.xml.soap.SOAPElement parent,
                                   javax.xml.soap.SOAPMessage message)
                            throws javax.xml.soap.SOAPException,
                                   ClassNotFoundException,
                                   InstantiationException,
                                   IllegalAccessException,
                                   NotSerializableException,
                                   IntrospectionException,
                                   InvocationTargetException
Turns a java object into a SOAP element. This method in most cases defers to SOAPUtils.objectToElement but will intercept instances of heavy I*E data structures and serialize them straight to SOAP.

Parameters:
eName - The element name to create.
object - The object to serialize.
parent - The parent element to add the new element to.
message - The associated SOAP message.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IntrospectionException
InvocationTargetException

serializeIEDataArray

private static javax.xml.soap.SOAPElement serializeIEDataArray(String eName,
                                                               int type,
                                                               Object[] objects,
                                                               javax.xml.soap.SOAPElement parent,
                                                               javax.xml.soap.SOAPMessage message,
                                                               String arrayMemberName)
                                                        throws javax.xml.soap.SOAPException,
                                                               ClassNotFoundException,
                                                               InstantiationException,
                                                               IllegalAccessException,
                                                               NotSerializableException,
                                                               IntrospectionException,
                                                               InvocationTargetException
Used internally to serialize arrays of I*E data structure objects. Since this is the IE version the objects must be from the com.infoengine.object.factory package.

Parameters:
eName - The array element name to create.
type - The type of object (must be one of SOAPUtils.TYPE_IE*).
objects - The array of objects.
parent - The parent element.
message - The SOAP message.
arrayMemberName - The name to use when creating array members.
Returns:
The SOAP array element.
Throws:
javax.xml.soap.SOAPException
ClassNotFoundException
InstantiationException
IllegalAccessException
NotSerializableException
IntrospectionException
InvocationTargetException

lookForVME

public static void lookForVME(Throwable t)