AdroitLogic UltraESB v1.7.0

org.adroitlogic.ultraesb.api.mediation
Interface SOAPSupport


public interface SOAPSupport

Mediation Support for SOAP based mediation

Since:
1.7.0

Method Summary
 void addStringAsSoapHeader(Message msg, java.lang.String name, java.lang.String uri, java.lang.String content)
          Adds a String as a new SOAP header
 void convertDOMToSoap11(Message m)
          Converts a DOM message to SOAP 1.1 by wrapping the message in a SOAP envelope and body
 void convertDOMToSoap12(Message m)
          Converts a DOM message to SOAP 1.2 by wrapping the message in a SOAP envelope and body
 void convertFromFI(Message m)
          Convert the payload of the current message from a FastInfoset binary to an XML message (Note the XML payload is still kept as a RawFileMessage by default and maybe converted into a DOM message if required)
 void convertSoapToDOM(Message m)
          Converts a SOAP message to DOM (POX) by stripping out the SOAP Envelope and Body and Header
 java.lang.Object convertSOAPToJAXBObject(Message msg, java.lang.Class clazz)
          Converts a SOAP payload into a JAXB Object.
 void convertSOAPToJSONStream(Message m)
          Convert the current SOAP message payload (which maybe available as any format such as raw file or DOM etc) into a file based JSON stream
 void convertSOAPToJSONStream(Message m, javax.xml.namespace.QName staringElement, boolean retainNSPrefixes)
          Convert the current SOAP message payload (which maybe available as any format such as raw file or DOM etc) into a file based JSON stream
 void convertToFI(Message m)
          Convert the XML message into a FastInfoset binary message
 void deleteSoapHeader(Message msg, java.lang.String name, java.lang.String uri)
          Delete a SOAP header and its descendants
 java.lang.String extractAsStringUsingXPath(Message m, java.lang.String exprn, java.lang.String[][] ns)
          Evaluate the given XPath expression against the XML payload, and return result as a String This method converts the current payload into a DOMMessage
 boolean filter(Message m, java.lang.String exprn, java.lang.String[][] ns)
          Evaluate the given boolean XPath expression over the XML payload
 boolean filter(Message m, java.lang.String exprn, java.lang.String[][] ns, java.lang.String regex)
          Evaluate the given XPath expression over the XML payload and compare the resulting String value with the regular expression for a match.
 java.lang.String getSoapAction(Message msg)
          Return the SOAPAction transport header
 java.lang.String getSoapAddressingAction(Message msg)
          Get the WSA Action header
 java.lang.String getSoapAddressingFaultTo(Message msg)
          Get the WSA FaultTo header
 java.lang.String getSoapAddressingFrom(Message msg)
          Get the WSA From header
 java.lang.String getSoapAddressingMessageID(Message msg)
          Get the WSA MessageID header
 java.lang.String getSoapAddressingReplyTo(Message msg)
          Get the WSA ReplyTo header
 java.lang.String getSoapAddressingTo(Message msg)
          Get the WSA To header
 java.lang.String getSoapFaultCode(Message msg)
          Extract the SOAP 1.1 Fault/faultcode or SOAP 1.2 Fault/Code/Value if exists
 java.lang.String getSoapFaultDetail(Message msg)
          Extract the SOAP 1.1 detail or SOAP 1.2 Detail if exists
 java.lang.String getSoapFaultString(Message msg)
          Extract the SOAP 1.1 Fault/faultstring or SOAP 1.2 Reason/Text if exists
 java.lang.String getSoapHeaderAsString(Message msg, java.lang.String namespace, java.lang.String name)
          Extract the SOAP 1.1/1.2 header value as a String
 java.util.Map getSoapHeadersAsStrings(Message m)
          Deprecated. Extract the SOAP 1.1/1.2 header values as a Strings
 boolean isSoap(Message msg)
          Check the message content type to see if it indicates a SOAP 1.1 or 1.2 message serialized as XML
 boolean remove(Message m, java.lang.String exprn, java.lang.String[][] ns)
          Remove the XPath expression specified node from the XML payload.
 void removeSoapHeader(Message msg, java.lang.String name, java.lang.String uri)
          Removes the specified SOAP header and its descendants if any from the payload
 void replaceStringAsSoapHeader(Message msg, java.lang.String name, java.lang.String uri, java.lang.String content)
          Replace String based SOAP header
 void serializeJAXBObjectAsSOAP11Stream(Message msg, java.lang.Object jaxb)
          Serialize a JAXB Object as a SOAP 1.1 Stream message
 void serializeJAXBObjectAsSOAP11Stream(Message msg, java.lang.Object jaxb, java.lang.String rootElement, java.lang.String uri)
          Serialize a JAXB Object as a SOAP 1.1 Stream message
 void serializeJAXBObjectAsSOAP12Stream(Message msg, java.lang.Object jaxb)
          Serialize a JAXB Object as a SOAP 1.2 Stream message
 void serializeJAXBObjectAsSOAP12Stream(Message msg, java.lang.Object jaxb, java.lang.String rootElement, java.lang.String uri)
          Serialize a JAXB Object as a SOAP 1.2 Stream message
 void setPayloadToSOAP11Fault(Message m, java.lang.String code, java.lang.String faultString, java.lang.String detail)
          Set the payload of the current message to a SOAP 1.1 fault message with the given code, faultString and detail
 void setPayloadToSOAP12Fault(Message m, java.lang.String code, java.lang.String reason, java.lang.String detail)
          Set the payload of the current message to a SOAP 1.2 fault message with the given code, reason and detail
 void splitAndProcess(Message msg, java.lang.String exprn, java.lang.String[][] ns, java.lang.String sequenceName, boolean ignoreErrors)
          Split current message into multiple messages using the given XPath expression, and hand over each such message to the given sequence
 void transform(Message msg, java.lang.String xsltFilename)
          Transform the message payload by XSLT (without any parameters), assuming a non DOM result and assuming that the complete message payload will be used as the source of the transformation, and the result will replace the complete message payload
 void transform(Message msg, java.lang.String xsltFilename, java.lang.String exprn, java.lang.String[][] ns)
          Transform the message payload by XSLT (without any parameters), assuming a non DOM result
 void transform(Message msg, java.lang.String xsltFilename, java.lang.String exprn, java.lang.String[][] ns, boolean domResult, java.util.Map parameters)
          Transform the message payload by XSLT
 void validate(Message m, java.lang.String schema)
          Validate the current message against one single schema
 void validate(Message m, java.lang.String[] schemas)
          Validate the current message against one or more schemas
 void validate(Message m, java.lang.String[] schemas, java.lang.String exprn, java.lang.String[][] ns)
          Validate the current message - or an element of it selected via an XPath expression - against one or more schemas
 

Method Detail

isSoap

boolean isSoap(Message msg)
Check the message content type to see if it indicates a SOAP 1.1 or 1.2 message serialized as XML

Parameters:
msg - the message to detect
Returns:
true if either SOAP 1.1 or 1.2 is indicated

getSoapAction

java.lang.String getSoapAction(Message msg)
Return the SOAPAction transport header

Parameters:
msg - message to extract the header from
Returns:
the SOAPAction transport header

convertFromFI

void convertFromFI(Message m)
Convert the payload of the current message from a FastInfoset binary to an XML message (Note the XML payload is still kept as a RawFileMessage by default and maybe converted into a DOM message if required)

Parameters:
m - the current message to be transformed

convertToFI

void convertToFI(Message m)
Convert the XML message into a FastInfoset binary message

Parameters:
m - the current message to be transformed

convertDOMToSoap11

void convertDOMToSoap11(Message m)
Converts a DOM message to SOAP 1.1 by wrapping the message in a SOAP envelope and body

Parameters:
m - the current message to be processed

convertDOMToSoap12

void convertDOMToSoap12(Message m)
Converts a DOM message to SOAP 1.2 by wrapping the message in a SOAP envelope and body

Parameters:
m - the current message to be processed

convertSoapToDOM

void convertSoapToDOM(Message m)
Converts a SOAP message to DOM (POX) by stripping out the SOAP Envelope and Body and Header

Parameters:
m - the current message containing a SOAP payload to convert to DOM/POX

convertSOAPToJSONStream

void convertSOAPToJSONStream(Message m)
Convert the current SOAP message payload (which maybe available as any format such as raw file or DOM etc) into a file based JSON stream

Parameters:
m - the message to be converted

convertSOAPToJSONStream

void convertSOAPToJSONStream(Message m,
                             javax.xml.namespace.QName staringElement,
                             boolean retainNSPrefixes)
Convert the current SOAP message payload (which maybe available as any format such as raw file or DOM etc) into a file based JSON stream

Parameters:
m - the message to be converted
staringElement - an optional starting element to begin conversion (e.g. first element of the SOAP body)
retainNSPrefixes - retain the namespace prefixes into JSON names for elements

filter

boolean filter(Message m,
               java.lang.String exprn,
               java.lang.String[][] ns,
               java.lang.String regex)
Evaluate the given XPath expression over the XML payload and compare the resulting String value with the regular expression for a match. This method converts the current payload into a DOMMessage

Parameters:
m - the current message
exprn - the XPath expression to evaluate against the message payload
ns - an optional array of namespace prefixes and namespace urls
regex - an optional regular expression to evaluate the XPath results' String value against
Returns:
true if the regular expression matches the String result of the XPath expression

filter

boolean filter(Message m,
               java.lang.String exprn,
               java.lang.String[][] ns)
Evaluate the given boolean XPath expression over the XML payload

Parameters:
m - the current message
exprn - the XPath expression to evaluate against the message payload
ns - an optional array of namespace prefixes and namespace urls
Returns:
true if the XPath expression evaluates to true

validate

void validate(Message m,
              java.lang.String[] schemas,
              java.lang.String exprn,
              java.lang.String[][] ns)
Validate the current message - or an element of it selected via an XPath expression - against one or more schemas

Parameters:
m - the message holding the payload for validation
schemas - an array of XSD filename to validate against. Note: the validator is sensitive to the order in which the Schemas are given. Otherwise you may end up with an error such as "SAXParseException: cvc-elt.1: Cannot find the declaration of element"
exprn - an optional XPath expression selecting the node for validation
ns - an optional array of namespace prefixes and namespaces used within the XPath expression

validate

void validate(Message m,
              java.lang.String[] schemas)
Validate the current message against one or more schemas

Parameters:
m - the message holding the payload for validation
schemas - an array of XSD filename to validate against Note: the validator is sensitive to the order in which the Schemas are given. Otherwise you may end up with an error such as "SAXParseException: cvc-elt.1: Cannot find the declaration of element"

validate

void validate(Message m,
              java.lang.String schema)
Validate the current message against one single schema

Parameters:
m - the message holding the payload for validation
schema - a XSD filename to validate against

transform

void transform(Message msg,
               java.lang.String xsltFilename,
               java.lang.String exprn,
               java.lang.String[][] ns,
               boolean domResult,
               java.util.Map parameters)
Transform the message payload by XSLT

Parameters:
msg - current message
xsltFilename - the XSLT filename
exprn - an optional XPath expression to select the source node for XSLT, and node to replace with the result
ns - an optional array of namespace prefixes and namespace urls
domResult - is the result desired as a DOM payload? (useful for further XML processing)
parameters - any XSLT parameters to be passed to the transformation

transform

void transform(Message msg,
               java.lang.String xsltFilename,
               java.lang.String exprn,
               java.lang.String[][] ns)
Transform the message payload by XSLT (without any parameters), assuming a non DOM result

Parameters:
msg - current message
xsltFilename - the XSLT filename
exprn - an optional XPath expression to select the source node for XSLT, and node to replace with the result
ns - an optional array of namespace prefixes and namespace urls

transform

void transform(Message msg,
               java.lang.String xsltFilename)
Transform the message payload by XSLT (without any parameters), assuming a non DOM result and assuming that the complete message payload will be used as the source of the transformation, and the result will replace the complete message payload

Parameters:
msg - current message
xsltFilename - the XSLT filename

removeSoapHeader

void removeSoapHeader(Message msg,
                      java.lang.String name,
                      java.lang.String uri)
Removes the specified SOAP header and its descendants if any from the payload

Parameters:
msg - the current message containing the payload
name - the local name of the header to be removed
uri - the name space uri of the soap header to be removed

addStringAsSoapHeader

void addStringAsSoapHeader(Message msg,
                           java.lang.String name,
                           java.lang.String uri,
                           java.lang.String content)
Adds a String as a new SOAP header

Parameters:
msg - the current message containing the payload
name - local name of the new header to be added
uri - the namespace uri of the soap header to be added
content - content of the new header

replaceStringAsSoapHeader

void replaceStringAsSoapHeader(Message msg,
                               java.lang.String name,
                               java.lang.String uri,
                               java.lang.String content)
Replace String based SOAP header

Parameters:
msg - the current message containing the payload
name - name of the header to be deleted
uri - the namespace uri of the soap header to be deleted
content - updated content for the SOAP header

deleteSoapHeader

void deleteSoapHeader(Message msg,
                      java.lang.String name,
                      java.lang.String uri)
Delete a SOAP header and its descendants

Parameters:
msg - the current message containing the payload
name - name of the header to be deleted
uri - the namespace uri of the soap header to be deleted

getSoapHeaderAsString

java.lang.String getSoapHeaderAsString(Message msg,
                                       java.lang.String namespace,
                                       java.lang.String name)
Extract the SOAP 1.1/1.2 header value as a String

Parameters:
msg - the SOAP message
namespace - namespace of the header element
name - the name of the header element
Returns:
the String value of the header

getSoapHeadersAsStrings

java.util.Map getSoapHeadersAsStrings(Message m)
Deprecated. Extract the SOAP 1.1/1.2 header values as a Strings

Parameters:
m - the SOAP message
Returns:
a Map of QNames and Strings of the text value

getSoapAddressingTo

java.lang.String getSoapAddressingTo(Message msg)
Get the WSA To header

Parameters:
msg - message to extract the header from
Returns:
the header value

getSoapAddressingAction

java.lang.String getSoapAddressingAction(Message msg)
Get the WSA Action header

Parameters:
msg - message to extract the header from
Returns:
the header value

getSoapAddressingReplyTo

java.lang.String getSoapAddressingReplyTo(Message msg)
Get the WSA ReplyTo header

Parameters:
msg - message to extract the header from
Returns:
the header value

getSoapAddressingFaultTo

java.lang.String getSoapAddressingFaultTo(Message msg)
Get the WSA FaultTo header

Parameters:
msg - message to extract the header from
Returns:
the header value

getSoapAddressingFrom

java.lang.String getSoapAddressingFrom(Message msg)
Get the WSA From header

Parameters:
msg - message to extract the header from
Returns:
the header value

getSoapAddressingMessageID

java.lang.String getSoapAddressingMessageID(Message msg)
Get the WSA MessageID header

Parameters:
msg - message to extract the header from
Returns:
the header value

setPayloadToSOAP11Fault

void setPayloadToSOAP11Fault(Message m,
                             java.lang.String code,
                             java.lang.String faultString,
                             java.lang.String detail)
Set the payload of the current message to a SOAP 1.1 fault message with the given code, faultString and detail

Parameters:
m - the current message
code - Local Name of the fault code - See http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383510 (null will default to "Server")
faultString - fault string, or null (defaults to "General Error")
detail - fault detail, or null (defaults to "Not available")

setPayloadToSOAP12Fault

void setPayloadToSOAP12Fault(Message m,
                             java.lang.String code,
                             java.lang.String reason,
                             java.lang.String detail)
Set the payload of the current message to a SOAP 1.2 fault message with the given code, reason and detail

Parameters:
m - the current message
code - Local Name of the fault code value - See http://www.w3.org/TR/soap12-part1/#faultcodes (null will default to "Receiver")
reason - fault reason, or null (defaults to "General Error" if null)
detail - fault detail, or null (defaults to "Not available")

getSoapFaultCode

java.lang.String getSoapFaultCode(Message msg)
Extract the SOAP 1.1 Fault/faultcode or SOAP 1.2 Fault/Code/Value if exists

Parameters:
msg - the message to use
Returns:
the fault code if exists

getSoapFaultString

java.lang.String getSoapFaultString(Message msg)
Extract the SOAP 1.1 Fault/faultstring or SOAP 1.2 Reason/Text if exists

Parameters:
msg - the message to use
Returns:
the fault code if exists

getSoapFaultDetail

java.lang.String getSoapFaultDetail(Message msg)
Extract the SOAP 1.1 detail or SOAP 1.2 Detail if exists

Parameters:
msg - the message to use
Returns:
the fault code if exists

remove

boolean remove(Message m,
               java.lang.String exprn,
               java.lang.String[][] ns)
Remove the XPath expression specified node from the XML payload. This method converts the current payload of the message into a DOMMessage

Parameters:
m - the current message
exprn - the XPath expression to evaluate against the message payload
ns - an optional array of namespace prefixes and namespace urls
Returns:
true if the node was removed, false if not

extractAsStringUsingXPath

java.lang.String extractAsStringUsingXPath(Message m,
                                           java.lang.String exprn,
                                           java.lang.String[][] ns)
Evaluate the given XPath expression against the XML payload, and return result as a String This method converts the current payload into a DOMMessage

Parameters:
m - the current message
exprn - the XPath expression to evaluate against the message payload
ns - an optional array of namespace prefixes and namespace urls
Returns:
the result of the XPath expression as a String, or null

splitAndProcess

void splitAndProcess(Message msg,
                     java.lang.String exprn,
                     java.lang.String[][] ns,
                     java.lang.String sequenceName,
                     boolean ignoreErrors)
                     throws java.lang.Exception
Split current message into multiple messages using the given XPath expression, and hand over each such message to the given sequence

Parameters:
msg - the current message to be split and processed
exprn - the XPath expression to split the message at
ns - name spaces used
sequenceName - the sequence to invoke on each resulting message
ignoreErrors - ignore any errors encountered during sequence execution
Throws:
java.lang.Exception - if the invoked sequence throws an exception

convertSOAPToJAXBObject

java.lang.Object convertSOAPToJAXBObject(Message msg,
                                         java.lang.Class clazz)
Converts a SOAP payload into a JAXB Object. This does NOT modify the current message

Parameters:
msg - the current message to read the payload from
clazz - the JAXB class to convert the payload into
Returns:
an Object of the specified class if the payload was successfully converted

serializeJAXBObjectAsSOAP11Stream

void serializeJAXBObjectAsSOAP11Stream(Message msg,
                                       java.lang.Object jaxb,
                                       java.lang.String rootElement,
                                       java.lang.String uri)
Serialize a JAXB Object as a SOAP 1.1 Stream message

Parameters:
msg - the current message to write the Object into as a SOAP 1.1 stream
jaxb - the JAXB Object to serialize
rootElement - root element local name for serialization
uri - namespace uri for the root element

serializeJAXBObjectAsSOAP11Stream

void serializeJAXBObjectAsSOAP11Stream(Message msg,
                                       java.lang.Object jaxb)
Serialize a JAXB Object as a SOAP 1.1 Stream message

Parameters:
msg - the current message to write the Object into as a SOAP 1.2 stream
jaxb - the JAXB Object to serialize

serializeJAXBObjectAsSOAP12Stream

void serializeJAXBObjectAsSOAP12Stream(Message msg,
                                       java.lang.Object jaxb,
                                       java.lang.String rootElement,
                                       java.lang.String uri)
Serialize a JAXB Object as a SOAP 1.2 Stream message

Parameters:
msg - the current message to write the Object into as a SOAP 1.2 stream
jaxb - the JAXB Object to serialize
rootElement - root element local name for serialization
uri - namespace uri for the root element

serializeJAXBObjectAsSOAP12Stream

void serializeJAXBObjectAsSOAP12Stream(Message msg,
                                       java.lang.Object jaxb)
Serialize a JAXB Object as a SOAP 1.2 Stream message

Parameters:
msg - the current message to write the Object into as a XML stream
jaxb - the JAXB Object to serialize

Copyright (c) 2010-2012 AdroitLogic Private Ltd. All rights reserved.