Class WSEndpointReference

    • Method Detail

      • createWithAddress

        @NotNull
        public WSEndpointReference createWithAddress​(@NotNull
                                                     String newAddress)
        Creates a new WSEndpointReference by replacing the address of this EPR to the new one.

        The following example shows how you can use this to force an HTTPS EPR, when the endpoint can serve both HTTP and HTTPS requests.

         if(epr.getAddress().startsWith("http:"))
           epr = epr.createWithAddress("https:"+epr.getAddress().substring(5));
         
        Parameters:
        newAddress - This is a complete URL to be written inside <Adress> element of the EPR, such as "http://foo.bar/abc/def"
      • toSpec

        @NotNull
        public jakarta.xml.ws.EndpointReference toSpec()
        Convert the EPR to the spec version. The actual type of EndpointReference to be returned depends on which version of the addressing spec this EPR conforms to.
        Throws:
        jakarta.xml.ws.WebServiceException - if the conversion fails, which can happen if the EPR contains invalid infoset (wrong namespace URI, etc.)
      • toSpec

        @NotNull
        public <T extends jakarta.xml.ws.EndpointReference> T toSpec​(Class<T> clazz)
        Converts the EPR to the specified spec version. If the the addressing version in use and the given class is different, then this may involve version conversion.
      • getPort

        @NotNull
        public <T> T getPort​(@NotNull
                             jakarta.xml.ws.Service jaxwsService,
                             @NotNull
                             Class<T> serviceEndpointInterface,
                             jakarta.xml.ws.WebServiceFeature... features)
        Creates a proxy that can be used to talk to this EPR.

        All the normal WS-Addressing processing happens automatically, such as setting the endpoint address to the address, and sending the reference parameters associated with this EPR as headers, etc.

      • createDispatch

        @NotNull
        public <T> jakarta.xml.ws.Dispatch<T> createDispatch​(@NotNull
                                                             jakarta.xml.ws.Service jaxwsService,
                                                             @NotNull
                                                             Class<T> type,
                                                             @NotNull
                                                             jakarta.xml.ws.Service.Mode mode,
                                                             jakarta.xml.ws.WebServiceFeature... features)
        Creates a Dispatch that can be used to talk to this EPR.

        All the normal WS-Addressing processing happens automatically, such as setting the endpoint address to the address, and sending the reference parameters associated with this EPR as headers, etc.

      • createDispatch

        @NotNull
        public jakarta.xml.ws.Dispatch<Object> createDispatch​(@NotNull
                                                              jakarta.xml.ws.Service jaxwsService,
                                                              @NotNull
                                                              jakarta.xml.bind.JAXBContext context,
                                                              @NotNull
                                                              jakarta.xml.ws.Service.Mode mode,
                                                              jakarta.xml.ws.WebServiceFeature... features)
        Creates a Dispatch that can be used to talk to this EPR.

        All the normal WS-Addressing processing happens automatically, such as setting the endpoint address to the address, and sending the reference parameters associated with this EPR as headers, etc.

      • getVersion

        @NotNull
        public AddressingVersion getVersion()
        Gets the addressing version of this EPR.
      • getAddress

        @NotNull
        public String getAddress()
        The value of the <wsa:address> header.
      • isAnonymous

        public boolean isAnonymous()
        Returns true if this has anonymous URI as the address.
      • isNone

        public boolean isNone()
        Returns true if this has none URI as the address.
      • asSource

        public Source asSource​(@NotNull
                               String localName)
        Returns a Source that represents this EPR.
        Parameters:
        localName - EPR uses a different root tag name depending on the context. The returned Source will use the given local name for the root element name.
      • writeTo

        public void writeTo​(@NotNull
                            String localName,
                            ContentHandler contentHandler,
                            ErrorHandler errorHandler,
                            boolean fragment)
                     throws SAXException
        Writes this EPR to the given ContentHandler.
        Parameters:
        localName - EPR uses a different root tag name depending on the context. The returned Source will use the given local name for the root element name.
        fragment - If true, generate a fragment SAX events without start/endDocument callbacks. If false, generate a full XML document event.
        Throws:
        SAXException
      • writeTo

        public void writeTo​(@NotNull
                            String localName,
                            @NotNull
                            XMLStreamWriter w)
                     throws XMLStreamException
        Writes this EPR into the given writer.
        Parameters:
        localName - EPR uses a different root tag name depending on the context. The returned Source will use the given local name
        Throws:
        XMLStreamException
      • createHeader

        public Header createHeader​(QName rootTagName)
        Returns a Header that wraps this WSEndpointReference.

        The returned header is immutable too, and can be reused with many Messages.

        Parameters:
        rootTagName - The header tag name to be used, such as <ReplyTo> or <FaultTo>. (It's bit ugly that this method takes QName and not just local name, unlike other methods. If it's making the caller's life miserable, then we can talk.)
      • addReferenceParametersToList

        public void addReferenceParametersToList​(HeaderList outbound)
        Deprecated.
        - use addReferenceParametersToList(MessageHeaders)
        Copies all the reference parameters in this EPR as headers to the given HeaderList.
      • addReferenceParametersToList

        public void addReferenceParametersToList​(MessageHeaders outbound)
        Copies all the reference parameters in this EPR as headers to the given MessageHeaders.
      • addReferenceParameters

        public void addReferenceParameters​(HeaderList headers)
        Copies all the reference parameters from the given HeaderList to this EPR
      • toString

        public String toString()
        Dumps the EPR infoset in a human-readable string.
        Overrides:
        toString in class Object
      • getName

        public QName getName()
        Gets the QName of the EndpointReference element.
        Specified by:
        getName in interface WSDLExtension
        Returns: