Package org.opensaml.soap.util

# Class SOAPSupport

java.lang.Object
org.opensaml.soap.util.SOAPSupport

public final class SOAPSupport extends Object
Helper methods for working with SOAP.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final org.slf4j.Logger`
`LOG`
Logger.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`SOAPSupport()`
Private constructor.

## Method Summary

Modifier and Type
Method
Description
`static void`
`addSOAP11ActorAttribute(XMLObject soapObject, String actorURI)`
Adds a `soap11:actor` attribute to the given SOAP object.
`static void`
`addSOAP11EncodingStyle(XMLObject soapObject, String encodingStyle)`
Adds a single encoding style to the given SOAP object.
`static void`
`addSOAP11EncodingStyles(XMLObject soapObject, List<String> encodingStyles)`
Adds a `soap11:encodingStyle` attribute to the given SOAP object.
`static void`
`addSOAP11MustUnderstandAttribute(XMLObject soapObject, boolean mustUnderstand)`
Adds a `soap11:mustUnderstand` attribute to the given SOAP object.
`static void`
`addSOAP12EncodingStyleAttribute(XMLObject soapObject, String style)`
Adds the `soap12:encodingStyle` attribute to the given soap object.
`static void`
`addSOAP12MustUnderstandAttribute(XMLObject soapObject, boolean mustUnderstand)`
Adds a `soap12:mustUnderstand` attribute to the given SOAP object.
`static void`
`addSOAP12RelayAttribute(XMLObject soapObject, boolean relay)`
Adds a `soap12:relay` attribute to the given SOAP object.
`static void`
`addSOAP12RoleAttribute(XMLObject soapObject, String role)`
Adds the `soap12:role` attribute to the given soap object.
`static Fault`
`buildSOAP11Fault(QName faultCode, String faultString, String faultActor, List<XMLObject> detailChildren, Map<QName,String> detailAttributes)`
Build a SOAP 1.1.
`static void`
`checkExceptionStackAndLogSizeExceeded(Throwable original)`
Check the specified Throwable and its children to see if a cause of the error was `SizeLimitExceededException`, and log it if so.
`static String`
`getSOAP11ActorAttribute(XMLObject soapObject)`
Gets the `soap11:actor` attribute from a given SOAP object.
`static List<String>`
`getSOAP11EncodingStyles(XMLObject soapObject)`
Gets the list value of the `soap11:encodingStyle` attribute from the given SOAP object.
`static boolean`
`getSOAP11MustUnderstandAttribute(XMLObject soapObject)`
Get the `soap11:mustUnderstand` attribute from a given SOAP object.
`static String`
`getSOAP12EncodingStyleAttribute(XMLObject soapObject)`
Gets the `soap12:encodingStyle`.
`static boolean`
`getSOAP12MustUnderstandAttribute(XMLObject soapObject)`
Get the `soap12:mustUnderstand` attribute from a given SOAP object.
`static boolean`
`getSOAP12RelayAttribute(XMLObject soapObject)`
Get the `soap12:relay` attribute from a given SOAP object.
`static String`
`getSOAP12RoleAttribute(XMLObject soapObject)`
Gets the `soap12:role`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### LOG

private static final org.slf4j.Logger LOG
Logger.

## Constructor Details

### SOAPSupport

private SOAPSupport()
Private constructor.

## Method Details

### addSOAP11MustUnderstandAttribute

public static void addSOAP11MustUnderstandAttribute(@Nonnull 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(@Nonnull 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(@Nonnull XMLObject soapObject, @Nonnull 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

@Nullable public static String getSOAP11ActorAttribute(@Nonnull 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(@Nonnull XMLObject soapObject, @Nonnull 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(@Nonnull XMLObject soapObject, @Nonnull 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

@Nullable public static List<String> getSOAP11EncodingStyles(@Nonnull 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(@Nonnull XMLObject soapObject, @Nonnull 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

@Nullable public static String getSOAP12EncodingStyleAttribute(@Nonnull 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(@Nonnull 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(@Nonnull 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(@Nonnull 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(@Nonnull 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(@Nonnull XMLObject soapObject, @Nonnull 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

@Nullable public static String getSOAP12RoleAttribute(@Nonnull 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

### buildSOAP11Fault

public static Fault buildSOAP11Fault(@Nonnull QName faultCode, @Nonnull String faultString, @Nullable String faultActor, @Nullable List<XMLObject> detailChildren, @Nullable 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

### checkExceptionStackAndLogSizeExceeded

public static void checkExceptionStackAndLogSizeExceeded(@Nullable Throwable original)
Check the specified Throwable and its children to see if a cause of the error was `SizeLimitExceededException`, and log it if so.

Parameters:
  `original` - the originally thrown error