Package org.opensaml.soap.util
Class SOAPSupport
java.lang.Object
org.opensaml.soap.util.SOAPSupport
Helper methods for working with SOAP.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addSOAP11ActorAttribute
(XMLObject soapObject, String actorURI) Adds asoap11: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 asoap11:encodingStyle
attribute to the given SOAP object.static void
addSOAP11MustUnderstandAttribute
(XMLObject soapObject, boolean mustUnderstand) Adds asoap11:mustUnderstand
attribute to the given SOAP object.static void
addSOAP12EncodingStyleAttribute
(XMLObject soapObject, String style) Adds thesoap12:encodingStyle
attribute to the given soap object.static void
addSOAP12MustUnderstandAttribute
(XMLObject soapObject, boolean mustUnderstand) Adds asoap12:mustUnderstand
attribute to the given SOAP object.static void
addSOAP12RelayAttribute
(XMLObject soapObject, boolean relay) Adds asoap12:relay
attribute to the given SOAP object.static void
addSOAP12RoleAttribute
(XMLObject soapObject, String role) Adds thesoap12: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 String
getSOAP11ActorAttribute
(XMLObject soapObject) Gets thesoap11:actor
attribute from a given SOAP object.getSOAP11EncodingStyles
(XMLObject soapObject) Gets the list value of thesoap11:encodingStyle
attribute from the given SOAP object.static boolean
getSOAP11MustUnderstandAttribute
(XMLObject soapObject) Get thesoap11:mustUnderstand
attribute from a given SOAP object.static String
getSOAP12EncodingStyleAttribute
(XMLObject soapObject) Gets thesoap12:encodingStyle
.static boolean
getSOAP12MustUnderstandAttribute
(XMLObject soapObject) Get thesoap12:mustUnderstand
attribute from a given SOAP object.static boolean
getSOAP12RelayAttribute
(XMLObject soapObject) Get thesoap12:relay
attribute from a given SOAP object.static String
getSOAP12RoleAttribute
(XMLObject soapObject) Gets thesoap12:role
.
-
Constructor Details
-
SOAPSupport
private SOAPSupport()Private constructor.
-
-
Method Details
-
addSOAP11MustUnderstandAttribute
public static void addSOAP11MustUnderstandAttribute(@Nonnull XMLObject soapObject, boolean mustUnderstand) Adds asoap11:mustUnderstand
attribute to the given SOAP object.- Parameters:
soapObject
- the SOAP object to add the attribute tomustUnderstand
- whether mustUnderstand is true or false
-
getSOAP11MustUnderstandAttribute
Get thesoap11: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
Adds asoap11:actor
attribute to the given SOAP object.- Parameters:
soapObject
- the SOAP object to add the attribute toactorURI
- the URI of the actor
-
getSOAP11ActorAttribute
Gets thesoap11: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 existingsoap11:encodingStyle
attribute is present, the given style will be added to the existing list.- Parameters:
soapObject
- the SOAP object to add the attribute toencodingStyle
- the encoding style to add
-
addSOAP11EncodingStyles
public static void addSOAP11EncodingStyles(@Nonnull XMLObject soapObject, @Nonnull List<String> encodingStyles) Adds asoap11:encodingStyle
attribute to the given SOAP object.- Parameters:
soapObject
- the SOAP object to add the attribute toencodingStyles
- the list of encoding styles to add
-
getSOAP11EncodingStyles
Gets the list value of thesoap11: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 thesoap12:encodingStyle
attribute to the given soap object.- Parameters:
soapObject
- object to which the encoding style attribute should be addedstyle
- the encoding style
-
getSOAP12EncodingStyleAttribute
Gets thesoap12: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 asoap12:mustUnderstand
attribute to the given SOAP object.- Parameters:
soapObject
- the SOAP object to add the attribute tomustUnderstand
- whether mustUnderstand is true or false
-
getSOAP12MustUnderstandAttribute
Get thesoap12: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
Adds asoap12:relay
attribute to the given SOAP object.- Parameters:
soapObject
- the SOAP object to add the attribute torelay
- whether relay is true or false
-
getSOAP12RelayAttribute
Get thesoap12: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
Adds thesoap12:role
attribute to the given soap object.- Parameters:
soapObject
- object to which the rol attribute should be addedrole
- the role
-
getSOAP12RoleAttribute
Gets thesoap12: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 @NonnullElements 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 elementsdetailAttributes
- the 'detail' element attributes- Returns:
- the new Fault element object
-