org.apache.cxf.wsdl

## Class EndpointReferenceUtils

- java.lang.Object
- - org.apache.cxf.wsdl.EndpointReferenceUtils

-     public final class EndpointReferenceUtils
      extends Object

  Provides utility methods for obtaining endpoint references, wsdl definitions, etc.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ANONYMOUS_ADDRESS`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Source` | `convertToXML(EndpointReferenceType epr)`
    `static EndpointReferenceType` | `duplicate(EndpointReferenceType ref)` Create a duplicate endpoint reference sharing all atributes
    `static String` | `getAddress(EndpointReferenceType ref)` Get the address from the provided endpoint reference.
    `static EndpointReferenceType` | `getAnonymousEndpointReference()` Create an anonymous endpoint reference.
    `static EndpointReferenceType` | `getEndpointReference(AttributedURIType address)`
    `static EndpointReferenceType` | `getEndpointReference(String address)` Create an endpoint reference for the provided address.
    `static EndpointReferenceType` | `getEndpointReference(URL wsdlUrl, QName serviceName, String portName)` Create an endpoint reference for the provided wsdl, service and portname.
    `static String` | `getEndpointReferenceId(Map<String,Object> messageContext)` Obtain the id String from the endpoint reference of the current dispatch.
    `static EndpointReferenceType` | `getEndpointReferenceWithId(QName serviceQName, String portName, String id, Bus bus)` Obtain a multiplexed endpoint reference for the deployed service that contains the provided id
    `static QName` | `getInterfaceName(EndpointReferenceType ref, Bus bus)`
    `static javax.wsdl.Port` | `getPort(WSDLManager manager, EndpointReferenceType ref)` Gets the WSDL port for the provided endpoint reference.
    `static String` | `getPortName(EndpointReferenceType ref)` Gets the port name of the provided endpoint reference.
    `static QName` | `getPortQName(EndpointReferenceType ref, Bus bus)`
    `static Schema` | `getSchema(ServiceInfo serviceInfo)`
    `static Schema` | `getSchema(ServiceInfo serviceInfo, Bus b)`
    `static QName` | `getServiceName(EndpointReferenceType ref, Bus bus)` Gets the service name of the provided endpoint reference.
    `static javax.xml.bind.JAXBElement<ServiceNameType>` | `getServiceNameType(QName serviceName, String portName)`
    `static javax.wsdl.Definition` | `getWSDLDefinition(WSDLManager manager, EndpointReferenceType ref)` Gets the WSDL definition for the provided endpoint reference.
    `static String` | `getWSDLLocation(EndpointReferenceType ref)`
    `static EndpointReferenceType` | `mint(EndpointReferenceType physical, Bus bus)` Mint logical endpoint reference via the Bus EndpointResolverRegistry.
    `static EndpointReferenceType` | `mint(QName serviceName, Bus bus)` Mint logical endpoint reference via the Bus EndpointResolverRegistry.
    `static EndpointReferenceType` | `renew(EndpointReferenceType logical, EndpointReferenceType physical, Bus bus)` Renew logical endpoint reference via the Bus EndpointResolverRegistry.
    `static EndpointReferenceType` | `resolve(EndpointReferenceType logical, Bus bus)` Resolve logical endpoint reference via the Bus EndpointResolverRegistry.
    `static void` | `setAddress(EndpointReferenceType ref, String address)` Set the address of the provided endpoint reference.
    `static void` | `setInterfaceName(EndpointReferenceType ref, QName portTypeName)`
    `static void` | `setMetadata(EndpointReferenceType ref, List<Source> metadata)` Sets the metadata on the provided endpoint reference.
    `static void` | `setPortName(EndpointReferenceType ref, String portName)`
    `static void` | `setServiceAndPortName(EndpointReferenceType ref, QName serviceName, String portName)` Sets the service and port name of the provided endpoint reference.
    `static void` | `setWSDLLocation(EndpointReferenceType ref, String... wsdlLocation)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ANONYMOUS_ADDRESS

          public static final String ANONYMOUS_ADDRESS

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setServiceAndPortName

          public static void setServiceAndPortName(EndpointReferenceType ref,
                                   QName serviceName,
                                   String portName)

      Sets the service and port name of the provided endpoint reference.
      Parameters:
        `ref` - the endpoint reference.
        `serviceName` - the name of service.
        `portName` - the port name.

    - #### getServiceNameType

          public static javax.xml.bind.JAXBElement<ServiceNameType> getServiceNameType(QName serviceName,
                                                                       String portName)

    - #### getServiceName

          public static QName getServiceName(EndpointReferenceType ref,
                             Bus bus)

      Gets the service name of the provided endpoint reference.
      Parameters:
        `ref` - the endpoint reference.
      Returns:
        the service name.

    - #### getPortName

          public static String getPortName(EndpointReferenceType ref)

      Gets the port name of the provided endpoint reference.
      Parameters:
        `ref` - the endpoint reference.
      Returns:
        the port name.

    - #### getPortQName

          public static QName getPortQName(EndpointReferenceType ref,
                           Bus bus)

    - #### setPortName

          public static void setPortName(EndpointReferenceType ref,
                         String portName)

    - #### setInterfaceName

          public static void setInterfaceName(EndpointReferenceType ref,
                              QName portTypeName)

    - #### getInterfaceName

          public static QName getInterfaceName(EndpointReferenceType ref,
                               Bus bus)

    - #### setWSDLLocation

          public static void setWSDLLocation(EndpointReferenceType ref,
                             String... wsdlLocation)

    - #### getWSDLLocation

          public static String getWSDLLocation(EndpointReferenceType ref)

    - #### setMetadata

          public static void setMetadata(EndpointReferenceType ref,
                         List<Source> metadata)
                                  throws EndpointUtilsException

      Sets the metadata on the provided endpoint reference.
      Parameters:
        `ref` - the endpoint reference.
        `metadata` - the list of metadata source.
      Throws:
        `EndpointUtilsException`

    - #### getWSDLDefinition

          public static javax.wsdl.Definition getWSDLDefinition(WSDLManager manager,
                                                EndpointReferenceType ref)
                                                         throws javax.wsdl.WSDLException

      Gets the WSDL definition for the provided endpoint reference.
      Parameters:
        `manager` - - the WSDL manager
        `ref` - - the endpoint reference
      Returns:
        Definition the wsdl definition
      Throws:
        `javax.wsdl.WSDLException`

    - #### getSchema

          public static Schema getSchema(ServiceInfo serviceInfo)

    - #### getSchema

          public static Schema getSchema(ServiceInfo serviceInfo,
                         Bus b)

    - #### getPort

          public static javax.wsdl.Port getPort(WSDLManager manager,
                                EndpointReferenceType ref)
                                         throws javax.wsdl.WSDLException

      Gets the WSDL port for the provided endpoint reference.
      Parameters:
        `manager` - - the WSDL manager
        `ref` - - the endpoint reference
      Returns:
        Port the wsdl port
      Throws:
        `javax.wsdl.WSDLException`

    - #### getAddress

          public static String getAddress(EndpointReferenceType ref)

      Get the address from the provided endpoint reference.
      Parameters:
        `ref` - - the endpoint reference
      Returns:
        String the address of the endpoint

    - #### setAddress

          public static void setAddress(EndpointReferenceType ref,
                        String address)

      Set the address of the provided endpoint reference.
      Parameters:
        `ref` - - the endpoint reference
        `address` - - the address

    - #### getEndpointReference

          public static EndpointReferenceType getEndpointReference(URL wsdlUrl,
                                                   QName serviceName,
                                                   String portName)

      Create an endpoint reference for the provided wsdl, service and portname.
      Parameters:
        `wsdlUrl` - - url of the wsdl that describes the service.
        `serviceName` - - the `QName` of the service.
        `portName` - - the name of the port.
      Returns:
        EndpointReferenceType - the endpoint reference

    - #### duplicate

          public static EndpointReferenceType duplicate(EndpointReferenceType ref)

      Create a duplicate endpoint reference sharing all atributes
      Parameters:
        `ref` - the reference to duplicate
      Returns:
        EndpointReferenceType - the duplicate endpoint reference

    - #### getEndpointReference

          public static EndpointReferenceType getEndpointReference(String address)

      Create an endpoint reference for the provided address.
      Parameters:
        `address` - - address URI
      Returns:
        EndpointReferenceType - the endpoint reference

    - #### getEndpointReference

          public static EndpointReferenceType getEndpointReference(AttributedURIType address)

    - #### getAnonymousEndpointReference

          public static EndpointReferenceType getAnonymousEndpointReference()

      Create an anonymous endpoint reference.
      Returns:
        EndpointReferenceType - the endpoint reference

    - #### resolve

          public static EndpointReferenceType resolve(EndpointReferenceType logical,
                                      Bus bus)

      Resolve logical endpoint reference via the Bus EndpointResolverRegistry.
      Parameters:
        `logical` - the abstract EPR to resolve
      Returns:
        the resolved concrete EPR if appropriate, null otherwise

    - #### renew

          public static EndpointReferenceType renew(EndpointReferenceType logical,
                                    EndpointReferenceType physical,
                                    Bus bus)

      Renew logical endpoint reference via the Bus EndpointResolverRegistry.
      Parameters:
        `logical` - the original abstract EPR (if still available)
        `physical` - the concrete EPR to renew
      Returns:
        the renewed concrete EPR if appropriate, null otherwise

    - #### mint

          public static EndpointReferenceType mint(QName serviceName,
                                   Bus bus)

      Mint logical endpoint reference via the Bus EndpointResolverRegistry.
      Parameters:
        `serviceName` - the given serviceName
      Returns:
        the newly minted EPR if appropriate, null otherwise

    - #### mint

          public static EndpointReferenceType mint(EndpointReferenceType physical,
                                   Bus bus)

      Mint logical endpoint reference via the Bus EndpointResolverRegistry.
      Parameters:
        `physical` - the concrete template EPR
      Returns:
        the newly minted EPR if appropriate, null otherwise

    - #### getEndpointReferenceWithId

          public static EndpointReferenceType getEndpointReferenceWithId(QName serviceQName,
                                                         String portName,
                                                         String id,
                                                         Bus bus)

      Obtain a multiplexed endpoint reference for the deployed service that contains the provided id
      Parameters:
        `serviceQName` - identified the target service
        `portName` - identifies a particular port of the service, may be null
        `id` - that must be embedded in the returned reference
        `bus` - the current bus
      Returns:
        a new reference or null if the target destination does not support destination mutiplexing

    - #### getEndpointReferenceId

          public static String getEndpointReferenceId(Map<String,Object> messageContext)

      Obtain the id String from the endpoint reference of the current dispatch.
      Parameters:
        `messageContext` - the current message context
      Returns:
        the id embedded in the current endpoint reference or null if not found

    - #### convertToXML

          public static Source convertToXML(EndpointReferenceType epr)

Apache CXF