Class W3CEndpointReferenceHelper
java.lang.Object
com.helger.smpclient.peppol.utils.W3CEndpointReferenceHelper
As the default WS-Addressing binding since JAXB 2.1 uses the
The issue with
The JIRA issue JAX_WS-1132 was filed to help dealing with this issue.
W3CEndpointReference class, we must also use this class, otherwise
JAXB would complain, that there are 2 contexts for the same namespace+element
combination.The issue with
W3CEndpointReference is that it can easily be created
using the W3CEndpointReferenceBuilder class, but it's not possible to
extract information from it (get....). This class offers a workaround by
using DOM serialization to access the content of a
W3CEndpointReference. In case the serialization tag names of
W3CEndpointReference change, this implementation has to be adopted!
The JIRA issue JAX_WS-1132 was filed to help dealing with this issue.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.xml.ws.wsaddressing.W3CEndpointReferencecreateEndpointReference(String sAddress) Create a new endpoint reference for the given address without reference parameters.static jakarta.xml.ws.wsaddressing.W3CEndpointReferencecreateEndpointReference(String sAddress, Iterable<Element> aReferenceParameters) Create a new endpoint reference for the given address, using the specified reference parameters.static StringgetAddress(jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference) Get the address contained in the passed endpoint reference.
See https://github.com/jakartaee/jax-ws-api/issues/167 why this is done so stupidlystatic ElementgetReferenceParameter(jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference, int nIndex) Get the reference parameter at the given indexstatic com.helger.commons.collection.impl.ICommonsList<Element> getReferenceParameters(jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference) Get a list of all reference parameters contained in the passed endpoint reference.
-
Method Details
-
createEndpointReference
@Nonnull public static jakarta.xml.ws.wsaddressing.W3CEndpointReference createEndpointReference(@Nonnull String sAddress) Create a new endpoint reference for the given address without reference parameters.- Parameters:
sAddress- The address to use. May not benullbut may be empty to .- Returns:
- The non-
nullendpoint reference for the given address
-
createEndpointReference
@Nonnull public static jakarta.xml.ws.wsaddressing.W3CEndpointReference createEndpointReference(@Nonnull String sAddress, @Nonnull Iterable<Element> aReferenceParameters) Create a new endpoint reference for the given address, using the specified reference parameters.- Parameters:
sAddress- The address to use. May not benullbut may be empty.aReferenceParameters- The non-nulllist of reference parameters. May not benull.- Returns:
- The non-
nullendpoint reference for the given address
-
getAddress
@Nullable public static String getAddress(@Nonnull jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference) Get the address contained in the passed endpoint reference.
See https://github.com/jakartaee/jax-ws-api/issues/167 why this is done so stupidly- Parameters:
aEndpointReference- The endpoint reference to retrieve the address from. May not benull.- Returns:
- The contained address.
-
getReferenceParameters
@Nullable public static com.helger.commons.collection.impl.ICommonsList<Element> getReferenceParameters(@Nonnull jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference) Get a list of all reference parameters contained in the passed endpoint reference.- Parameters:
aEndpointReference- The endpoint reference to retrieve the reference parameters. May not benull.- Returns:
- A mutable element list
-
getReferenceParameter
@Nullable public static Element getReferenceParameter(@Nonnull jakarta.xml.ws.wsaddressing.W3CEndpointReference aEndpointReference, @Nonnegative int nIndex) Get the reference parameter at the given index- Parameters:
aEndpointReference- The object to retrieve the reference parameter from. May not benull.nIndex- The index to retrieve. Must be ≥ 0.- Returns:
nullif the index is invalid
-