org.opensaml.ws.soap.util
Class SOAPHelper

java.lang.Object
  extended by org.opensaml.ws.soap.util.SOAPHelper

public final class SOAPHelper
extends Object

Helper methods for working with SOAP.


Method Summary
static void addActorAttribute(org.opensaml.xml.XMLObject soapObject, String actorURI)
          Deprecated. use instead addSOAP11ActorAttribute(XMLObject, String).
static void addEncodingStyle(org.opensaml.xml.XMLObject soapObject, String encodingStyle)
          Deprecated. use instead addSOAP11EncodingStyle(XMLObject, String).
static void addEncodingStyles(org.opensaml.xml.XMLObject soapObject, List<String> encodingStyles)
          Deprecated. use instead addSOAP11EncodingStyles(XMLObject, List).
static void addHeaderBlock(MessageContext messageContext, org.opensaml.xml.XMLObject headerBlock)
          Add a header block to the SOAP envelope contained within the specified message context's MessageContext.getOutboundMessage().
static void addMustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject, boolean mustUnderstand)
          Deprecated. use instead addSOAP11MustUnderstandAttribute(XMLObject, boolean).
static void addSOAP11ActorAttribute(org.opensaml.xml.XMLObject soapObject, String actorURI)
          Adds a soap11:actor attribute to the given SOAP object.
static void addSOAP11EncodingStyle(org.opensaml.xml.XMLObject soapObject, String encodingStyle)
          Adds a single encoding style to the given SOAP object.
static void addSOAP11EncodingStyles(org.opensaml.xml.XMLObject soapObject, List<String> encodingStyles)
          Adds a soap11:encodingStyle attribute to the given SOAP object.
static void addSOAP11HeaderBlock(Envelope envelope, org.opensaml.xml.XMLObject headerBlock)
          Add a header to the SOAP 1.1 Envelope.
static void addSOAP11MustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject, boolean mustUnderstand)
          Adds a soap11:mustUnderstand attribute to the given SOAP object.
static void addSOAP12EncodingStyleAttribute(org.opensaml.xml.XMLObject soapObject, String style)
          Adds the soap12:encodingStyle attribute to the given soap object.
static void addSOAP12MustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject, boolean mustUnderstand)
          Adds a soap12:mustUnderstand attribute to the given SOAP object.
static void addSOAP12RelayAttribute(org.opensaml.xml.XMLObject soapObject, boolean relay)
          Adds a soap12:relay attribute to the given SOAP object.
static void addSOAP12RoleAttribute(org.opensaml.xml.XMLObject soapObject, String role)
          Adds the soap12:role attribute to the given soap object.
static Fault buildSOAP11Fault(QName faultCode, String faultString, String faultActor, List<org.opensaml.xml.XMLObject> detailChildren, Map<QName,String> detailAttributes)
          Build a SOAP 1.1.
static List<org.opensaml.xml.XMLObject> getInboundHeaderBlock(MessageContext msgContext, QName headerName, Set<String> targetNodes, boolean isFinalDestination)
          Get a header block from the SOAP envelope contained within the specified message context's MessageContext.getInboundMessage().
static List<org.opensaml.xml.XMLObject> getOutboundHeaderBlock(MessageContext msgContext, QName headerName, Set<String> targetNodes, boolean isFinalDestination)
          Get a header block from the SOAP envelope contained within the specified message context's MessageContext.getOutboundMessage().
static String getSOAP11ActorAttribute(org.opensaml.xml.XMLObject soapObject)
          Gets the soap11:actor attribute from a given SOAP object.
static List<String> getSOAP11EncodingStyles(org.opensaml.xml.XMLObject soapObject)
          Gets the list value of the soap11:encodingStyle attribute from the given SOAP object.
static List<org.opensaml.xml.XMLObject> getSOAP11HeaderBlock(Envelope envelope, QName headerName, Set<String> targetNodes, boolean isFinalDestination)
          Get a header block from the SOAP 1.1 envelope.
static boolean getSOAP11MustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject)
          Get the soap11:mustUnderstand attribute from a given SOAP object.
static String getSOAP12EncodingStyleAttribute(org.opensaml.xml.XMLObject soapObject)
          Gets the soap12:encodingStyle.
static boolean getSOAP12MustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject)
          Get the soap12:mustUnderstand attribute from a given SOAP object.
static boolean getSOAP12RelayAttribute(org.opensaml.xml.XMLObject soapObject)
          Get the soap12:relay attribute from a given SOAP object.
static String getSOAP12RoleAttribute(org.opensaml.xml.XMLObject soapObject)
          Gets the soap12:role.
static boolean isInboundSOAPMessage(MessageContext messageContext)
          Determine whether the inbound message represented by the message context contains a SOAP Envelope.
static boolean isSOAP11HeaderTargetedToNode(org.opensaml.xml.XMLObject header, Set<String> nodeActors, boolean isFinalDestination)
          Evaluate whether the specified header block is targeted to a SOAP 1.1 node given the specified parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addSOAP11MustUnderstandAttribute

public static void addSOAP11MustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject,
                                                    boolean mustUnderstand)
Adds a soap11:mustUnderstand attribute to the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
mustUnderstand - whether mustUnderstand is true or false

getSOAP11MustUnderstandAttribute

public static boolean getSOAP11MustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject)
Get the soap11:mustUnderstand attribute from a given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
Returns:
value of the mustUnderstand attribute, or false if not present

addSOAP11ActorAttribute

public static void addSOAP11ActorAttribute(org.opensaml.xml.XMLObject soapObject,
                                           String actorURI)
Adds a soap11:actor attribute to the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
actorURI - the URI of the actor

getSOAP11ActorAttribute

public static String getSOAP11ActorAttribute(org.opensaml.xml.XMLObject soapObject)
Gets the soap11:actor attribute from a given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
Returns:
the value of the actor attribute, or null if not present

addSOAP11EncodingStyle

public static void addSOAP11EncodingStyle(org.opensaml.xml.XMLObject soapObject,
                                          String encodingStyle)
Adds a single encoding style to the given SOAP object. If an existing soap11:encodingStyle attribute is present, the given style will be added to the existing list.

Parameters:
soapObject - the SOAP object to add the attribute to
encodingStyle - the encoding style to add

addSOAP11EncodingStyles

public static void addSOAP11EncodingStyles(org.opensaml.xml.XMLObject soapObject,
                                           List<String> encodingStyles)
Adds a soap11:encodingStyle attribute to the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
encodingStyles - the list of encoding styles to add

getSOAP11EncodingStyles

public static List<String> getSOAP11EncodingStyles(org.opensaml.xml.XMLObject soapObject)
Gets the list value of the soap11:encodingStyle attribute from the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
Returns:
the list of encoding styles, or null if not present

addSOAP12EncodingStyleAttribute

public static void addSOAP12EncodingStyleAttribute(org.opensaml.xml.XMLObject soapObject,
                                                   String style)
Adds the soap12:encodingStyle attribute to the given soap object.

Parameters:
soapObject - object to which the encoding style attribute should be added
style - the encoding style

getSOAP12EncodingStyleAttribute

public static String getSOAP12EncodingStyleAttribute(org.opensaml.xml.XMLObject soapObject)
Gets the soap12:encodingStyle.

Parameters:
soapObject - the SOAP object which may contain the encoding style
Returns:
the encoding style or null if it is not set on the object

addSOAP12MustUnderstandAttribute

public static void addSOAP12MustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject,
                                                    boolean mustUnderstand)
Adds a soap12:mustUnderstand attribute to the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
mustUnderstand - whether mustUnderstand is true or false

getSOAP12MustUnderstandAttribute

public static boolean getSOAP12MustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject)
Get the soap12:mustUnderstand attribute from a given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
Returns:
value of the mustUnderstand attribute, or false if not present

addSOAP12RelayAttribute

public static void addSOAP12RelayAttribute(org.opensaml.xml.XMLObject soapObject,
                                           boolean relay)
Adds a soap12:relay attribute to the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
relay - whether relay is true or false

getSOAP12RelayAttribute

public static boolean getSOAP12RelayAttribute(org.opensaml.xml.XMLObject soapObject)
Get the soap12:relay attribute from a given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
Returns:
value of the relay attribute, or false if not present

addSOAP12RoleAttribute

public static void addSOAP12RoleAttribute(org.opensaml.xml.XMLObject soapObject,
                                          String role)
Adds the soap12:role attribute to the given soap object.

Parameters:
soapObject - object to which the rol attribute should be added
role - the role

getSOAP12RoleAttribute

public static String getSOAP12RoleAttribute(org.opensaml.xml.XMLObject soapObject)
Gets the soap12:role.

Parameters:
soapObject - the SOAP object which may contain the role
Returns:
the role or null if it is not set on the object

addActorAttribute

public static void addActorAttribute(org.opensaml.xml.XMLObject soapObject,
                                     String actorURI)
Deprecated. use instead addSOAP11ActorAttribute(XMLObject, String).

Adds a soap11:actor attribute to the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
actorURI - the URI of the actor

addEncodingStyle

public static void addEncodingStyle(org.opensaml.xml.XMLObject soapObject,
                                    String encodingStyle)
Deprecated. use instead addSOAP11EncodingStyle(XMLObject, String).

Adds a single encoding style to the given SOAP object. If an existing soap11:encodingStyle attribute is present, the given style will be added to the existing list.

Parameters:
soapObject - the SOAP object to add the attribute to
encodingStyle - the encoding style to add

addEncodingStyles

public static void addEncodingStyles(org.opensaml.xml.XMLObject soapObject,
                                     List<String> encodingStyles)
Deprecated. use instead addSOAP11EncodingStyles(XMLObject, List).

Adds a soap11:encodingStyle attribute to the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
encodingStyles - the list of encoding styles to add

addMustUnderstandAttribute

public static void addMustUnderstandAttribute(org.opensaml.xml.XMLObject soapObject,
                                              boolean mustUnderstand)
Deprecated. use instead addSOAP11MustUnderstandAttribute(XMLObject, boolean).

Adds a soap11:mustUnderstand attribute to the given SOAP object.

Parameters:
soapObject - the SOAP object to add the attribute to
mustUnderstand - whether mustUnderstand is true or false

addHeaderBlock

public static void addHeaderBlock(MessageContext messageContext,
                                  org.opensaml.xml.XMLObject headerBlock)
Add a header block to the SOAP envelope contained within the specified message context's MessageContext.getOutboundMessage().

Parameters:
messageContext - the message context being processed
headerBlock - the header block to add

addSOAP11HeaderBlock

public static void addSOAP11HeaderBlock(Envelope envelope,
                                        org.opensaml.xml.XMLObject headerBlock)
Add a header to the SOAP 1.1 Envelope.

Parameters:
envelope - the SOAP 1.1 envelope to process
headerBlock - the header to add

getInboundHeaderBlock

public static List<org.opensaml.xml.XMLObject> getInboundHeaderBlock(MessageContext msgContext,
                                                                     QName headerName,
                                                                     Set<String> targetNodes,
                                                                     boolean isFinalDestination)
Get a header block from the SOAP envelope contained within the specified message context's MessageContext.getInboundMessage().

Parameters:
msgContext - the message context being processed
headerName - the name of the header block to return
targetNodes - the explicitly specified SOAP node actors (1.1) or roles (1.2) for which the header is desired
isFinalDestination - true specifies that headers targeted for message final destination should be returned, false means they should not be returned
Returns:
the list of matching header blocks

getOutboundHeaderBlock

public static List<org.opensaml.xml.XMLObject> getOutboundHeaderBlock(MessageContext msgContext,
                                                                      QName headerName,
                                                                      Set<String> targetNodes,
                                                                      boolean isFinalDestination)
Get a header block from the SOAP envelope contained within the specified message context's MessageContext.getOutboundMessage().

Parameters:
msgContext - the message context being processed
headerName - the name of the header block to return
targetNodes - the explicitly specified SOAP node actors (1.1) or roles (1.2) for which the header is desired
isFinalDestination - true specifies that headers targeted for message final destination should be returned, false specifies they should not be returned
Returns:
the list of matching header blocks

getSOAP11HeaderBlock

public static List<org.opensaml.xml.XMLObject> getSOAP11HeaderBlock(Envelope envelope,
                                                                    QName headerName,
                                                                    Set<String> targetNodes,
                                                                    boolean isFinalDestination)
Get a header block from the SOAP 1.1 envelope.

Parameters:
envelope - the SOAP 1.1 envelope to process
headerName - the name of the header block to return
targetNodes - the explicitly specified SOAP node actors for which the header is desired
isFinalDestination - true specifies that headers targeted for message final destination should be returned, false specifies they should not be returned
Returns:
the list of matching header blocks

isSOAP11HeaderTargetedToNode

public static boolean isSOAP11HeaderTargetedToNode(org.opensaml.xml.XMLObject header,
                                                   Set<String> nodeActors,
                                                   boolean isFinalDestination)
Evaluate whether the specified header block is targeted to a SOAP 1.1 node given the specified parameters.

Parameters:
header - the header to evaluate
nodeActors - the explicitly specified node actors for which the header is desired
isFinalDestination - true specifies that headers targeted for message final destination should be returned, false specifies they should not be returned
Returns:
the list of matching header blocks

isInboundSOAPMessage

public static boolean isInboundSOAPMessage(MessageContext messageContext)
Determine whether the inbound message represented by the message context contains a SOAP Envelope.

Parameters:
messageContext - the current message context
Returns:
true if the inbound message contains a SOAP Envelope, false otherwise

buildSOAP11Fault

public static Fault buildSOAP11Fault(QName faultCode,
                                     String faultString,
                                     String faultActor,
                                     List<org.opensaml.xml.XMLObject> detailChildren,
                                     Map<QName,String> detailAttributes)
Build a SOAP 1.1. Fault element.

Parameters:
faultCode - the 'faultcode' QName (required)
faultString - the 'faultstring' value (required)
faultActor - the 'faultactor' value (may be null)
detailChildren - the 'detail' child elements
detailAttributes - the 'detail' element attributes
Returns:
the new Fault element object


Copyright © 2006-2013 Internet2. All Rights Reserved.