Class EndpointReferenceHelper


  • public class EndpointReferenceHelper
    extends Object
    The methods in this class are used to process EndpointReference objects according to the rules of the 2005/08 (Final) and 2004/08 (submission) WS-Addressing specifications.
    • Constructor Detail

      • EndpointReferenceHelper

        public EndpointReferenceHelper()
    • Method Detail

      • fromOM

        public static void fromOM​(EndpointReference epr,
                                  OMElement eprOMElement,
                                  String addressingNamespace)
                           throws AxisFault
        Populates an endpoint reference based on the OMElement and WS-Addressing namespace that is passed in.
        Parameters:
        epr - an endpoint reference instance to hold the info.
        eprOMElement - an element of endpoint reference type
        addressingNamespace - 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 the OMElement. 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 the String 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 the String 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 the OMElement 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 the OMElement 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 an OMElement 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 from
        addressingNamespace - the WS-Addressing namespace associated with the EPR.
        Returns:
        an instance of ServiceName. The return value is never null.
        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 from
        addressingNamespace - the WS-Addressing namespace associated with the EPR.
        Returns:
        an instance of InterfaceName. The return value is never null.
        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 from
        addressingNamespace - the WS-Addressing namespace associated with the EPR.
        Returns:
        an instance of WSDLLocation. The return value is never null.
        Throws:
        AxisFault
      • setServiceNameMetadata

        public static void setServiceNameMetadata​(OMFactory factory,
                                                  EndpointReference epr,
                                                  String addressingNamespace,
                                                  ServiceName serviceName)
                                           throws AxisFault
        Adds an instance of ServiceName as metadata to the specified EPR. The metadata is mapped to a WS-Addressing EPR ServiceName element.
        Parameters:
        factory - an OMFactory
        epr - the EPR to retrieve the attribute from
        addressingNamespace - the WS-Addressing namespace associated with the EPR.
        serviceName - an instance of ServiceName that contains the metadata
        Throws:
        AxisFault
      • setInterfaceNameMetadata

        public static void setInterfaceNameMetadata​(OMFactory factory,
                                                    EndpointReference epr,
                                                    String addressingNamespace,
                                                    InterfaceName interfaceName)
                                             throws AxisFault
        Adds an instance of InterfaceName as metadata to the specified EPR. The metadata is mapped to a WS-Addressing EPR PortType or InterfaceName element.
        Parameters:
        factory - an OMFactory
        epr - the EPR to retrieve the attribute from
        addressingNamespace - the WS-Addressing namespace associated with the EPR.
        interfaceName - an instance of InterfaceName that contains the metadata
        Throws:
        AxisFault
      • setWSDLLocationMetadata

        public static void setWSDLLocationMetadata​(OMFactory factory,
                                                   EndpointReference epr,
                                                   String addressingNamespace,
                                                   WSDLLocation wsdlLocation)
                                            throws AxisFault
        Adds an instance of WSDLLocation as metadata to the specified EPR. The metadata is mapped to a wsdli:wsdlLocation attribute.
        Parameters:
        factory - an OMFactory
        epr - the EPR to retrieve the attribute from
        addressingNamespace - the WS-Addressing namespace associated with the EPR.
        wsdlLocation - an instance of WSDLLocation that contains the metadata
        Throws:
        AxisFault