org.mule.module.saaj
Class SaajUtils

java.lang.Object
  extended by org.mule.module.saaj.SaajUtils

public class SaajUtils
extends Object

Support methods for working with SAAJ


Constructor Summary
SaajUtils()
           
 
Method Summary
static javax.xml.soap.SOAPMessage buildSOAPMessage(InputStream input, Map<String,String> headers, javax.xml.soap.MessageFactory messageFactory)
          Build a SOAPMessage from an InputStream.
static javax.xml.soap.SOAPMessage buildSOAPMessage(InputStream input, javax.xml.soap.MessageFactory messageFactory)
          Build a SOAPMessage from an InputStream.
static boolean containsFault(javax.xml.soap.SOAPMessage soapMessage)
          Determine if a SOAP fault is present in a SOAPMessage's body
static Node getBodyContent(javax.xml.soap.SOAPBody body)
          Extract the first Node contaning the payload of a SOAPBody/
static byte[] getSOAPMessageAsBytes(javax.xml.soap.SOAPMessage message)
          Serializes a SOAPMessage as XML encoded as a byte array
static String getSOAPMessageAsString(javax.xml.soap.SOAPMessage message)
          Serialize a SOAPMessage as a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaajUtils

public SaajUtils()
Method Detail

buildSOAPMessage

public static javax.xml.soap.SOAPMessage buildSOAPMessage(InputStream input,
                                                          javax.xml.soap.MessageFactory messageFactory)
Build a SOAPMessage from an InputStream.

Parameters:
input - the stream of XML to create the SOAPMessage from.
messageFactory - a reference to the MessageFactory to use
Returns:
the SOAPMessage constructed from the input

buildSOAPMessage

public static javax.xml.soap.SOAPMessage buildSOAPMessage(InputStream input,
                                                          Map<String,String> headers,
                                                          javax.xml.soap.MessageFactory messageFactory)
Build a SOAPMessage from an InputStream.

Parameters:
input - the InputStream to build the message from
headers - A Map used to populate the SOAP headers of the SOAPMessage
messageFactory - A reference to the MessageFactory to be used
Returns:
the constructed SOAPMessage

getSOAPMessageAsBytes

public static byte[] getSOAPMessageAsBytes(javax.xml.soap.SOAPMessage message)
Serializes a SOAPMessage as XML encoded as a byte array

Parameters:
message - the SOAPMessage to encode as bytes
Returns:
the encoded SOAPMessage

getSOAPMessageAsString

public static String getSOAPMessageAsString(javax.xml.soap.SOAPMessage message)
Serialize a SOAPMessage as a String

Parameters:
message - the SOAPMessage
Returns:
the String value of the SOAPMessage

getBodyContent

public static Node getBodyContent(javax.xml.soap.SOAPBody body)
Extract the first Node contaning the payload of a SOAPBody/

Parameters:
body - the SOAPBody to extract the payload from
Returns:
the first Node of the payload

containsFault

public static boolean containsFault(javax.xml.soap.SOAPMessage soapMessage)
Determine if a SOAP fault is present in a SOAPMessage's body

Parameters:
soapMessage - the SOAPMessage to evaluate
Returns:
true if the message contains a fault, false if not


Copyright © 2011 MuleSoft, Inc. All Rights Reserved.