|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.ws.api.addressing.WSEndpointReference
public final class WSEndpointReference
Internal representation of the EPR.
Instances of this class are immutable and thread-safe.
AddressingVersion.anonymousEpr
Nested Class Summary | |
---|---|
class |
WSEndpointReference.Metadata
Parses the Metadata in an EPR and provides convenience methods to access the metadata. |
(package private) class |
WSEndpointReference.SAXBufferProcessorImpl
Filtering SAXBufferProcessor that replaces the root tag name. |
Method Summary | ||
---|---|---|
void |
addReferenceParameters(HeaderList outbound)
Copies all the reference parameters in this EPR as headers to the given HeaderList . |
|
Source |
asSource(String localName)
Returns a Source that represents this EPR. |
|
static WSEndpointReference |
create(javax.xml.ws.EndpointReference epr)
Converts from EndpointReference . |
|
|
createDispatch(javax.xml.ws.Service jaxwsService,
Class<T> type,
javax.xml.ws.Service.Mode mode,
javax.xml.ws.WebServiceFeature... features)
Creates a Dispatch that can be used to talk to this EPR. |
|
javax.xml.ws.Dispatch<Object> |
createDispatch(javax.xml.ws.Service jaxwsService,
JAXBContext context,
javax.xml.ws.Service.Mode mode,
javax.xml.ws.WebServiceFeature... features)
Creates a Dispatch that can be used to talk to this EPR. |
|
Header |
createHeader(QName rootTagName)
Returns a Header that wraps this WSEndpointReference . |
|
WSEndpointReference |
createWithAddress(String newAddress)
Creates a new WSEndpointReference by replacing the address of this EPR
to the new one. |
|
WSEndpointReference |
createWithAddress(URI newAddress)
|
|
WSEndpointReference |
createWithAddress(URL newAddress)
|
|
String |
getAddress()
The value of the <wsa:address> header. |
|
WSEndpointReference.Metadata |
getMetaData()
Parses the metadata inside this EPR and obtains it in a easy-to-process form. |
|
|
getPort(javax.xml.ws.Service jaxwsService,
Class<T> serviceEndpointInterface,
javax.xml.ws.WebServiceFeature... features)
Creates a proxy that can be used to talk to this EPR. |
|
AddressingVersion |
getVersion()
Gets the addressing version of this EPR. |
|
boolean |
isAnonymous()
Returns true if this has anonymous URI as the address . |
|
boolean |
isNone()
Returns true if this has none URI
as the address . |
|
javax.xml.stream.XMLStreamReader |
read(String localName)
Reads this EPR as XMLStreamReader . |
|
javax.xml.ws.EndpointReference |
toSpec()
Convert the EPR to the spec version. |
|
|
toSpec(Class<T> clazz)
Converts the EPR to the specified spec version. |
|
String |
toString()
Dumps the EPR infoset in a human-readable string. |
|
void |
writeTo(String localName,
ContentHandler contentHandler,
ErrorHandler errorHandler,
boolean fragment)
Writes this EPR to the given ContentHandler . |
|
void |
writeTo(String localName,
javax.xml.stream.XMLStreamWriter w)
Writes this EPR into the given writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WSEndpointReference(javax.xml.ws.EndpointReference epr, AddressingVersion version)
EndpointReference
.
This method performs the data conversion, so it's slow. Do not use this method in a performance critical path.
public WSEndpointReference(javax.xml.ws.EndpointReference epr)
EndpointReference
.
This method performs the data conversion, so it's slow. Do not use this method in a performance critical path.
public WSEndpointReference(com.sun.xml.stream.buffer.XMLStreamBuffer infoset, AddressingVersion version)
WSEndpointReference
that wraps a given infoset.
public WSEndpointReference(InputStream infoset, AddressingVersion version) throws javax.xml.stream.XMLStreamException
WSEndpointReference
by parsing an infoset.
javax.xml.stream.XMLStreamException
public WSEndpointReference(javax.xml.stream.XMLStreamReader in, AddressingVersion version) throws javax.xml.stream.XMLStreamException
WSEndpointReference
from the given infoset.
The XMLStreamReader
must point to either a document or an element.
javax.xml.stream.XMLStreamException
public WSEndpointReference(URL address, AddressingVersion version)
WSEndpointReference(String, AddressingVersion)
public WSEndpointReference(URI address, AddressingVersion version)
WSEndpointReference(String, AddressingVersion)
public WSEndpointReference(String address, AddressingVersion version)
WSEndpointReference
that only has an address.
public WSEndpointReference(@NotNull AddressingVersion version, @NotNull String address, @Nullable QName service, @Nullable QName port, @Nullable QName portType, @Nullable List<Element> metadata, @Nullable String wsdlAddress, @Nullable List<Element> referenceParameters)
This version takes various information about metadata, and creates an EPR that has the necessary embedded WSDL.
Method Detail |
---|
@Nullable public static WSEndpointReference create(@Nullable javax.xml.ws.EndpointReference epr)
EndpointReference
.
This handles null EndpointReference
correctly.
Call WSEndpointReference(EndpointReference)
directly
if you know it's not null.
@NotNull public WSEndpointReference createWithAddress(@NotNull URI newAddress)
createWithAddress(String)
@NotNull public WSEndpointReference createWithAddress(@NotNull URL newAddress)
createWithAddress(String)
@NotNull public WSEndpointReference createWithAddress(@NotNull String newAddress)
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));
newAddress
- This is a complete URL to be written inside <Adress> element of the EPR,
such as "http://foo.bar/abc/def"@NotNull public javax.xml.ws.EndpointReference toSpec()
EndpointReference
to be returned depends on which version
of the addressing spec this EPR conforms to.
javax.xml.ws.WebServiceException
- if the conversion fails, which can happen if the EPR contains
invalid infoset (wrong namespace URI, etc.)@NotNull public <T extends javax.xml.ws.EndpointReference> T toSpec(Class<T> clazz)
the addressing version in use
and
the given class is different, then this may involve version conversion.
@NotNull public <T> T getPort(@NotNull javax.xml.ws.Service jaxwsService, @NotNull Class<T> serviceEndpointInterface, javax.xml.ws.WebServiceFeature... features)
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.
@NotNull public <T> javax.xml.ws.Dispatch<T> createDispatch(@NotNull javax.xml.ws.Service jaxwsService, @NotNull Class<T> type, @NotNull javax.xml.ws.Service.Mode mode, javax.xml.ws.WebServiceFeature... features)
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.
@NotNull public javax.xml.ws.Dispatch<Object> createDispatch(@NotNull javax.xml.ws.Service jaxwsService, @NotNull JAXBContext context, @NotNull javax.xml.ws.Service.Mode mode, javax.xml.ws.WebServiceFeature... features)
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.
@NotNull public AddressingVersion getVersion()
@NotNull public String getAddress()
public boolean isAnonymous()
address
.
public boolean isNone()
none URI
as the address
.
public javax.xml.stream.XMLStreamReader read(@NotNull String localName) throws javax.xml.stream.XMLStreamException
XMLStreamReader
.
localName
- EPR uses a different root tag name depending on the context.
The returned XMLStreamReader
will use the given local name
for the root element name.
javax.xml.stream.XMLStreamException
public Source asSource(@NotNull String localName)
Source
that represents this EPR.
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.public void writeTo(@NotNull String localName, ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException
ContentHandler
.
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.
SAXException
public void writeTo(@NotNull String localName, @NotNull javax.xml.stream.XMLStreamWriter w) throws javax.xml.stream.XMLStreamException
localName
- EPR uses a different root tag name depending on the context.
The returned Source
will use the given local name
javax.xml.stream.XMLStreamException
public Header createHeader(QName rootTagName)
Header
that wraps this WSEndpointReference
.
The returned header is immutable too, and can be reused with
many Message
s.
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.)public void addReferenceParameters(HeaderList outbound)
HeaderList
.
public String toString()
toString
in class Object
@NotNull public WSEndpointReference.Metadata getMetaData()
See WSEndpointReference.Metadata
class for what's avaliable as "metadata".
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |