Package org.apache.axis2.addressing
Class EndpointReferenceHelper
- java.lang.Object
-
- org.apache.axis2.addressing.EndpointReferenceHelper
-
public class EndpointReferenceHelper extends Object
The methods in this class are used to processEndpointReference
objects according to the rules of the 2005/08 (Final) and 2004/08 (submission) WS-Addressing specifications.
-
-
Constructor Summary
Constructors Constructor Description EndpointReferenceHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EndpointReference
fromOM(OMElement eprOMElement)
Populates an endpoint reference based on theOMElement
that is passed in.static String
fromOM(EndpointReference epr, OMElement eprOMElement)
Populates an endpoint reference based on theOMElement
.static void
fromOM(EndpointReference epr, OMElement eprOMElement, String addressingNamespace)
Populates an endpoint reference based on theOMElement
and WS-Addressing namespace that is passed in.static EndpointReference
fromString(String eprString)
Populates an endpoint reference based on theString
that is passed in.static InterfaceName
getInterfaceNameMetadata(EndpointReference epr, String addressingNamespace)
Retrieves the WS-Addressing EPR PortType, or InterfaceName, element from an EPR, as appropriate.static ServiceName
getServiceNameMetadata(EndpointReference epr, String addressingNamespace)
Retrieves the WS-Addressing EPR ServiceName element from an EPR.static WSDLLocation
getWSDLLocationMetadata(EndpointReference epr, String addressingNamespace)
Retrieves the wsdli:wsdlLocation attribute from an EPR.static void
setInterfaceNameMetadata(OMFactory factory, EndpointReference epr, String addressingNamespace, InterfaceName interfaceName)
Adds an instance ofInterfaceName
as metadata to the specified EPR.static void
setServiceNameMetadata(OMFactory factory, EndpointReference epr, String addressingNamespace, ServiceName serviceName)
Adds an instance ofServiceName
as metadata to the specified EPR.static void
setWSDLLocationMetadata(OMFactory factory, EndpointReference epr, String addressingNamespace, WSDLLocation wsdlLocation)
Adds an instance ofWSDLLocation
as metadata to the specified EPR.static OMElement
toOM(OMFactory factory, EndpointReference epr, QName qname, String addressingNamespace)
Creates anOMElement
based on the properties of the endpoint reference.
-
-
-
Method Detail
-
fromOM
public static void fromOM(EndpointReference epr, OMElement eprOMElement, String addressingNamespace) throws AxisFault
Populates an endpoint reference based on theOMElement
and WS-Addressing namespace that is passed in.- Parameters:
epr
- an endpoint reference instance to hold the info.eprOMElement
- an element of endpoint reference typeaddressingNamespace
- the namespace of the WS-Addressing spec to comply with.- Throws:
AxisFault
- if unable to locate an address element, or if the specified namespace is different to the actual namespace.- See Also:
fromOM(OMElement)
-
fromOM
public static String fromOM(EndpointReference epr, OMElement eprOMElement) throws AxisFault
Populates an endpoint reference based on theOMElement
. Returns the WS-Addressing namespace of the endpoint reference.- Parameters:
epr
- an endpoint reference instance to hold the info. If the endpoint reference is null then just the WS-Addressing namespace is returned.eprOMElement
- an element of endpoint reference type- Returns:
- a string representing the WS-Addressing namespace of the endpoint reference.
- Throws:
AxisFault
- if unable to locate an address element.
-
fromString
public static EndpointReference fromString(String eprString) throws AxisFault
Populates an endpoint reference based on theString
that is passed in. If the http://schemas.xmlsoap.org/ws/2004/08/addressing namespace is in effect then any reference properties will be saved as reference parameters. Regardless of the addressing namespace in effect, any elements present in theString
that are not recognised are saved as extensibility elements.- Parameters:
eprString
- string from the element of endpoint reference type- Throws:
AxisFault
- if unable to locate an address element
-
fromOM
public static EndpointReference fromOM(OMElement eprOMElement) throws AxisFault
Populates an endpoint reference based on theOMElement
that is passed in. If the http://schemas.xmlsoap.org/ws/2004/08/addressing namespace is in effect then any reference properties will be saved as reference parameters. Regardless of the addressing namespace in effect, any elements present in theOMElement
that are not recognised are saved as extensibility elements.- Parameters:
eprOMElement
- an element of endpoint reference type- Throws:
AxisFault
- if unable to locate an address element
-
toOM
public static OMElement toOM(OMFactory factory, EndpointReference epr, QName qname, String addressingNamespace) throws AxisFault
Creates anOMElement
based on the properties of the endpoint reference. The output may differ based on the addressing namespace that is in effect when this method is called. If the http://www.w3.org/2005/08/addressing namespace is in effect, and a metadata property has been defined for the endpoint reference, then there will be a metadata element to contain the property in the output. If the http://schemas.xmlsoap.org/ws/2004/08/addressing namespace is in effect, however, then no metadata element will be included in the output, even if a metadata property element has been defined.- Parameters:
factory
-epr
-qname
-addressingNamespace
-- Returns:
- Throws:
AxisFault
-
getServiceNameMetadata
public static ServiceName getServiceNameMetadata(EndpointReference epr, String addressingNamespace) throws AxisFault
Retrieves the WS-Addressing EPR ServiceName element from an EPR.- Parameters:
epr
- the EPR to retrieve the element fromaddressingNamespace
- the WS-Addressing namespace associated with the EPR.- Returns:
- an instance of
ServiceName
. The return value is nevernull
. - Throws:
AxisFault
-
getInterfaceNameMetadata
public static InterfaceName getInterfaceNameMetadata(EndpointReference epr, String addressingNamespace) throws AxisFault
Retrieves the WS-Addressing EPR PortType, or InterfaceName, element from an EPR, as appropriate.- Parameters:
epr
- the EPR to retrieve the element fromaddressingNamespace
- the WS-Addressing namespace associated with the EPR.- Returns:
- an instance of
InterfaceName
. The return value is nevernull
. - Throws:
AxisFault
-
getWSDLLocationMetadata
public static WSDLLocation getWSDLLocationMetadata(EndpointReference epr, String addressingNamespace) throws AxisFault
Retrieves the wsdli:wsdlLocation attribute from an EPR.- Parameters:
epr
- the EPR to retrieve the attribute fromaddressingNamespace
- the WS-Addressing namespace associated with the EPR.- Returns:
- an instance of
WSDLLocation
. The return value is nevernull
. - Throws:
AxisFault
-
setServiceNameMetadata
public static void setServiceNameMetadata(OMFactory factory, EndpointReference epr, String addressingNamespace, ServiceName serviceName) throws AxisFault
Adds an instance ofServiceName
as metadata to the specified EPR. The metadata is mapped to a WS-Addressing EPR ServiceName element.- Parameters:
factory
- anOMFactory
epr
- the EPR to retrieve the attribute fromaddressingNamespace
- the WS-Addressing namespace associated with the EPR.serviceName
- an instance ofServiceName
that contains the metadata- Throws:
AxisFault
-
setInterfaceNameMetadata
public static void setInterfaceNameMetadata(OMFactory factory, EndpointReference epr, String addressingNamespace, InterfaceName interfaceName) throws AxisFault
Adds an instance ofInterfaceName
as metadata to the specified EPR. The metadata is mapped to a WS-Addressing EPR PortType or InterfaceName element.- Parameters:
factory
- anOMFactory
epr
- the EPR to retrieve the attribute fromaddressingNamespace
- the WS-Addressing namespace associated with the EPR.interfaceName
- an instance ofInterfaceName
that contains the metadata- Throws:
AxisFault
-
setWSDLLocationMetadata
public static void setWSDLLocationMetadata(OMFactory factory, EndpointReference epr, String addressingNamespace, WSDLLocation wsdlLocation) throws AxisFault
Adds an instance ofWSDLLocation
as metadata to the specified EPR. The metadata is mapped to a wsdli:wsdlLocation attribute.- Parameters:
factory
- anOMFactory
epr
- the EPR to retrieve the attribute fromaddressingNamespace
- the WS-Addressing namespace associated with the EPR.wsdlLocation
- an instance ofWSDLLocation
that contains the metadata- Throws:
AxisFault
-
-