Class SoapUtil
-
- All Implemented Interfaces:
public class SoapUtilSOAP utility functions.
-
-
Method Summary
Modifier and Type Method Description <T> voidsetBody(T element, SoapMessage dest)Stores element in destined SOAP body. <T> Optional<T>getBody(SoapMessage src, Class<T> destType)Tries to retrieve SOAP body element from SoapMessage. StringcreateUriFromUuid(UUID uuid)Creates a URI representation of a UUID. UUIDcreateUuidFromUri(String uri)Converts from a URI to a UUID. StringdetermineRequestDistinguishedName(RequestResponseObject requestResponseObject)Determines the caller's distinguished name based on the given request-response object. StringcreateRandomUuidUri()Creates a URI with a random UUID. voidsetWsaAction(SoapMessage response, String action)Takes a response message and sets the WS-Addressing action header. SoapMessagecreateMessage()Creates an empty SOAP message. SoapMessagecreateMessage(Envelope envelope)Creates a SOAP message with the given envelope. SoapMessagecreateMessage(String wsaAction)Creates a SOAP message with a specific action and empty body. SoapMessagecreateMessage(String wsaAction, @Nullable() Object firstBodyElement)Creates a SOAP message with a specific action and first body element. SoapMessagecreateMessage(String wsaAction, String wsaTo)Creates a SOAP message with a specific action and to element. SoapMessagecreateMessage(String wsaAction, String wsaTo, @Nullable() Object firstBodyElement)Creates a SOAP message with a specific action, to and first body element. SoapMessagecreateMessage(String wsaAction, String wsaTo, @Nullable() Object firstBodyElement, @Nullable() ReferenceParametersType referenceParameters)Creates a SOAP message with a specific action, to, the first body element as well as reference parameters. -
-
Method Detail
-
setBody
<T> void setBody(T element, SoapMessage dest)
Stores element in destined SOAP body.
- Parameters:
element- element to store indest.dest- SOAP message to storeelementin.
-
getBody
<T> Optional<T> getBody(SoapMessage src, Class<T> destType)
Tries to retrieve SOAP body element from SoapMessage.
- Parameters:
src- the source message.destType- type of first element in body.- Returns:
an instance of T, or empty if conversion fails.
-
createUriFromUuid
String createUriFromUuid(UUID uuid)
Creates a URI representation of a UUID.
- Parameters:
uuid- the UUID to convert.- Returns:
a UUID URN.
-
createUuidFromUri
UUID createUuidFromUri(String uri)
Converts from a URI to a UUID.
- Parameters:
uri- the URI to convert.- Returns:
the converted UUID.
-
determineRequestDistinguishedName
@Nullable() String determineRequestDistinguishedName(RequestResponseObject requestResponseObject)
Determines the caller's distinguished name based on the given request-response object.
The string is using the format defined in RFC 2253.
- Parameters:
requestResponseObject- the request-response object containing the communication context.- Returns:
the caller's distinguished name, or null if no X509 certificate is found in the transport info.
-
createRandomUuidUri
String createRandomUuidUri()
Creates a URI with a random UUID.
- Returns:
the UUID URN.
-
setWsaAction
void setWsaAction(SoapMessage response, String action)
Takes a response message and sets the WS-Addressing action header.
- Parameters:
response- the SOAP response message.action- the action to put to the response message.
-
createMessage
SoapMessage createMessage()
Creates an empty SOAP message.
- Returns:
a new SOAP message.
-
createMessage
SoapMessage createMessage(Envelope envelope)
Creates a SOAP message with the given envelope.
- Parameters:
envelope- the envelope to put to the SOAP message.- Returns:
a new SOAP message.
-
createMessage
SoapMessage createMessage(String wsaAction)
Creates a SOAP message with a specific action and empty body.
- Parameters:
wsaAction- the action header to set.- Returns:
a new SOAP message.
-
createMessage
SoapMessage createMessage(String wsaAction, @Nullable() Object firstBodyElement)
Creates a SOAP message with a specific action and first body element.
- Parameters:
wsaAction- the action header to set.firstBodyElement- the first child of the body element.- Returns:
a new SOAP message.
-
createMessage
SoapMessage createMessage(String wsaAction, String wsaTo)
Creates a SOAP message with a specific action and to element.
- Parameters:
wsaAction- the action header to set.wsaTo- the to header to set.- Returns:
a new SOAP message.
-
createMessage
SoapMessage createMessage(String wsaAction, String wsaTo, @Nullable() Object firstBodyElement)
Creates a SOAP message with a specific action, to and first body element.
- Parameters:
wsaAction- the action header to set.wsaTo- the to header to set.firstBodyElement- the first child of the body element.- Returns:
a new SOAP message.
-
createMessage
SoapMessage createMessage(String wsaAction, String wsaTo, @Nullable() Object firstBodyElement, @Nullable() ReferenceParametersType referenceParameters)
Creates a SOAP message with a specific action, to, the first body element as well as reference parameters.
- Parameters:
wsaAction- the action header to set.wsaTo- the to header to set.firstBodyElement- the first child of the body element.referenceParameters- reference parameters to attach to the message.- Returns:
a new SOAP message.
-
-
-
-