| java.lang.Object com.sun.xml.ws.api.addressing.WSEndpointReference
WSEndpointReference | final public class WSEndpointReference (Code) | | Internal representation of the EPR.
Instances of this class are immutable and thread-safe.
author: Kohsuke Kawaguchi See Also: AddressingVersion.anonymousEpr |
Inner Class :class SAXBufferProcessorImpl extends SAXBufferProcessor | |
Inner Class :public class Metadata | |
Constructor Summary | |
public | WSEndpointReference(EndpointReference epr, AddressingVersion version) Creates from the spec version of
EndpointReference . | public | WSEndpointReference(EndpointReference epr) Creates from the spec version of
EndpointReference . | public | WSEndpointReference(XMLStreamBuffer infoset, AddressingVersion version) Creates a
WSEndpointReference that wraps a given infoset. | public | WSEndpointReference(InputStream infoset, AddressingVersion version) Creates a
WSEndpointReference by parsing an infoset. | public | WSEndpointReference(XMLStreamReader in, AddressingVersion version) Creates a
WSEndpointReference from the given infoset. | public | WSEndpointReference(URL address, AddressingVersion version) | public | WSEndpointReference(URI address, AddressingVersion version) | public | WSEndpointReference(String address, AddressingVersion version) Creates a
WSEndpointReference that only has an address. | public | WSEndpointReference(AddressingVersion version, String address, QName service, QName port, QName portType, List<Element> metadata, String wsdlAddress, List<Element> referenceParameters) Creates an EPR from individual components. |
Method Summary | |
public void | addReferenceParameters(HeaderList outbound) Copies all the reference parameters in this EPR as headers
to the given
HeaderList . | public Source | asSource(String localName) Returns a
Source that represents this EPR. | public static WSEndpointReference | create(EndpointReference epr) Converts from
EndpointReference . | public Dispatch<T> | createDispatch(Service jaxwsService, Class<T> type, Service.Mode mode, WebServiceFeature... features) Creates a
Dispatch that can be used to talk to this EPR. | public Dispatch<Object> | createDispatch(Service jaxwsService, JAXBContext context, Service.Mode mode, WebServiceFeature... features) Creates a
Dispatch that can be used to talk to this EPR. | public Header | createHeader(QName rootTagName) Returns a
Header that wraps this
WSEndpointReference .
The returned header is immutable too, and can be reused with
many
Message s.
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. | public WSEndpointReference | createWithAddress(URI newAddress) | public WSEndpointReference | createWithAddress(URL newAddress) | public WSEndpointReference | createWithAddress(String newAddress) Creates a new
WSEndpointReference by replacing the address of this EPR
to the new one. | public String | getAddress() The value of the <wsa:address> header. | public Metadata | getMetaData() Parses the metadata inside this EPR and obtains it in a easy-to-process form. | public T | getPort(Service jaxwsService, Class<T> serviceEndpointInterface, WebServiceFeature... features) Creates a proxy that can be used to talk to this EPR. | public AddressingVersion | getVersion() Gets the addressing version of this EPR. | public boolean | isAnonymous() Returns true if this has anonymous URI as the
WSEndpointReference.getAddress() address . | public boolean | isNone() Returns true if this has
AddressingVersion.noneUri none URI as the
WSEndpointReference.getAddress() address . | public XMLStreamReader | read(String localName) Reads this EPR as
XMLStreamReader . | public EndpointReference | toSpec() Convert the EPR to the spec version. | public T | toSpec(Class<T> clazz) Converts the EPR to the specified spec version. | public String | toString() Dumps the EPR infoset in a human-readable string. | public void | writeTo(String localName, ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) Writes this EPR to the given
ContentHandler . | public void | writeTo(String localName, XMLStreamWriter w) Writes this EPR into the given writer. |
WSEndpointReference | public WSEndpointReference(EndpointReference epr)(Code) | | Creates from the spec version of
EndpointReference .
This method performs the data conversion, so it's slow.
Do not use this method in a performance critical path.
|
WSEndpointReference | public WSEndpointReference(AddressingVersion version, String address, QName service, QName port, QName portType, List<Element> metadata, String wsdlAddress, List<Element> referenceParameters)(Code) | | Creates an EPR from individual components.
This version takes various information about metadata, and creates an EPR that has
the necessary embedded WSDL.
|
addReferenceParameters | public void addReferenceParameters(HeaderList outbound)(Code) | | Copies all the reference parameters in this EPR as headers
to the given
HeaderList .
|
asSource | public Source asSource(String localName)(Code) | | 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 namefor the root element name. |
createHeader | public Header createHeader(QName rootTagName)(Code) | | Returns a
Header that wraps this
WSEndpointReference .
The returned header is immutable too, and can be reused with
many
Message s.
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, thenwe can talk.) |
createWithAddress | public WSEndpointReference createWithAddress(String newAddress)(Code) | | 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" |
getAddress | public String getAddress()(Code) | | The value of the <wsa:address> header.
|
getMetaData | public Metadata getMetaData()(Code) | | Parses the metadata inside this EPR and obtains it in a easy-to-process form.
See
Metadata class for what's avaliable as "metadata".
|
getPort | public T getPort(Service jaxwsService, Class<T> serviceEndpointInterface, WebServiceFeature... features)(Code) | | 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
WSEndpointReference.getAddress() the address ,
and sending the reference parameters associated with this EPR as
headers, etc.
|
toSpec | public EndpointReference toSpec()(Code) | | 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: WebServiceException - if the conversion fails, which can happen if the EPR containsinvalid infoset (wrong namespace URI, etc.) |
toSpec | public T toSpec(Class<T> clazz)(Code) | | Converts the EPR to the specified spec version.
If the
WSEndpointReference.getVersion() the addressing version in use and
the given class is different, then this may involve version conversion.
|
toString | public String toString()(Code) | | Dumps the EPR infoset in a human-readable string.
|
writeTo | public void writeTo(String localName, ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException(Code) | | 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 namefor the root element name. Parameters: fragment - If true, generate a fragment SAX events without start/endDocument callbacks.If false, generate a full XML document event. |
writeTo | public void writeTo(String localName, XMLStreamWriter w) throws XMLStreamException(Code) | | 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 |
|
|