|
||||||||||
| 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 | |
|---|---|
static class |
WSEndpointReference.EPRExtension
Represents an extensibility element inside an EndpointReference |
class |
WSEndpointReference.Metadata
Parses the Metadata in an EPR and provides convenience methods to access the metadata. |
| Constructor Summary | |
|---|---|
WSEndpointReference(AddressingVersion version,
java.lang.String address,
javax.xml.namespace.QName service,
javax.xml.namespace.QName port,
javax.xml.namespace.QName portType,
java.util.List<org.w3c.dom.Element> metadata,
java.lang.String wsdlAddress,
java.util.List<org.w3c.dom.Element> referenceParameters)
Creates an EPR from individual components. |
|
WSEndpointReference(AddressingVersion version,
java.lang.String address,
javax.xml.namespace.QName service,
javax.xml.namespace.QName port,
javax.xml.namespace.QName portType,
java.util.List<org.w3c.dom.Element> metadata,
java.lang.String wsdlAddress,
java.util.List<org.w3c.dom.Element> referenceParameters,
java.util.Collection<WSEndpointReference.EPRExtension> extns,
java.util.Map<javax.xml.namespace.QName,java.lang.String> attributes)
Creates an EPR from individual components. |
|
WSEndpointReference(AddressingVersion version,
java.lang.String address,
javax.xml.namespace.QName service,
javax.xml.namespace.QName port,
javax.xml.namespace.QName portType,
java.util.List<org.w3c.dom.Element> metadata,
java.lang.String wsdlAddress,
java.lang.String wsdlTargetNamepsace,
java.util.List<org.w3c.dom.Element> referenceParameters,
java.util.List<org.w3c.dom.Element> elements,
java.util.Map<javax.xml.namespace.QName,java.lang.String> attributes)
Creates an EPR from individual components. |
|
WSEndpointReference(javax.xml.ws.EndpointReference epr)
Creates from the spec version of EndpointReference. |
|
WSEndpointReference(javax.xml.ws.EndpointReference epr,
AddressingVersion version)
Creates from the spec version of EndpointReference. |
|
WSEndpointReference(java.io.InputStream infoset,
AddressingVersion version)
Creates a WSEndpointReference by parsing an infoset. |
|
WSEndpointReference(java.lang.String address,
AddressingVersion version)
Creates a WSEndpointReference that only has an address. |
|
WSEndpointReference(java.net.URI address,
AddressingVersion version)
|
|
WSEndpointReference(java.net.URL address,
AddressingVersion version)
|
|
WSEndpointReference(com.sun.xml.stream.buffer.XMLStreamBuffer infoset,
AddressingVersion version)
Creates a WSEndpointReference that wraps a given infoset. |
|
WSEndpointReference(javax.xml.stream.XMLStreamReader in,
AddressingVersion version)
Creates a WSEndpointReference from the given infoset. |
|
| Method Summary | ||
|---|---|---|
void |
addReferenceParameters(HeaderList headers)
Copies all the reference parameters from the given HeaderList
to this EPR |
|
void |
addReferenceParametersToList(HeaderList outbound)
Deprecated. - use addReferenceParametersToList(MessageHeaders) |
|
void |
addReferenceParametersToList(MessageHeaders outbound)
Copies all the reference parameters in this EPR as headers to the given MessageHeaders. |
|
javax.xml.transform.Source |
asSource(java.lang.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,
java.lang.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<java.lang.Object> |
createDispatch(javax.xml.ws.Service jaxwsService,
javax.xml.bind.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(javax.xml.namespace.QName rootTagName)
Returns a Header that wraps this WSEndpointReference. |
|
WSEndpointReference |
createWithAddress(java.lang.String newAddress)
Creates a new WSEndpointReference by replacing the address of this EPR
to the new one. |
|
WSEndpointReference |
createWithAddress(java.net.URI newAddress)
|
|
WSEndpointReference |
createWithAddress(java.net.URL newAddress)
|
|
java.lang.String |
getAddress()
The value of the <wsa:address> header. |
|
WSEndpointReference.EPRExtension |
getEPRExtension(javax.xml.namespace.QName extnQName)
Returns the first extensibility element inside EPR root element with input QName. |
|
java.util.Collection<WSEndpointReference.EPRExtension> |
getEPRExtensions()
|
|
WSEndpointReference.Metadata |
getMetaData()
Parses the metadata inside this EPR and obtains it in a easy-to-process form. |
|
javax.xml.namespace.QName |
getName()
Gets the QName of the EndpointReference element. |
|
|
getPort(javax.xml.ws.Service jaxwsService,
java.lang.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(java.lang.String localName)
Reads this EPR as XMLStreamReader. |
|
javax.xml.ws.EndpointReference |
toSpec()
Convert the EPR to the spec version. |
|
|
toSpec(java.lang.Class<T> clazz)
Converts the EPR to the specified spec version. |
|
java.lang.String |
toString()
Dumps the EPR infoset in a human-readable string. |
|
void |
writeTo(java.lang.String localName,
org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ErrorHandler errorHandler,
boolean fragment)
Writes this EPR to the given ContentHandler. |
|
void |
writeTo(java.lang.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(java.io.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(java.net.URL address,
AddressingVersion version)
WSEndpointReference(String, AddressingVersion)
public WSEndpointReference(java.net.URI address,
AddressingVersion version)
WSEndpointReference(String, AddressingVersion)
public WSEndpointReference(java.lang.String address,
AddressingVersion version)
WSEndpointReference that only has an address.
public WSEndpointReference(@NotNull
AddressingVersion version,
@NotNull
java.lang.String address,
@Nullable
javax.xml.namespace.QName service,
@Nullable
javax.xml.namespace.QName port,
@Nullable
javax.xml.namespace.QName portType,
@Nullable
java.util.List<org.w3c.dom.Element> metadata,
@Nullable
java.lang.String wsdlAddress,
@Nullable
java.util.List<org.w3c.dom.Element> referenceParameters)
This version takes various information about metadata, and creates an EPR that has the necessary embedded WSDL.
public WSEndpointReference(@NotNull
AddressingVersion version,
@NotNull
java.lang.String address,
@Nullable
javax.xml.namespace.QName service,
@Nullable
javax.xml.namespace.QName port,
@Nullable
javax.xml.namespace.QName portType,
@Nullable
java.util.List<org.w3c.dom.Element> metadata,
@Nullable
java.lang.String wsdlAddress,
@Nullable
java.util.List<org.w3c.dom.Element> referenceParameters,
@Nullable
java.util.Collection<WSEndpointReference.EPRExtension> extns,
@Nullable
java.util.Map<javax.xml.namespace.QName,java.lang.String> attributes)
This version takes various information about metadata, and creates an EPR that has the necessary embedded WSDL.
public WSEndpointReference(@NotNull
AddressingVersion version,
@NotNull
java.lang.String address,
@Nullable
javax.xml.namespace.QName service,
@Nullable
javax.xml.namespace.QName port,
@Nullable
javax.xml.namespace.QName portType,
@Nullable
java.util.List<org.w3c.dom.Element> metadata,
@Nullable
java.lang.String wsdlAddress,
@Nullable
java.lang.String wsdlTargetNamepsace,
@Nullable
java.util.List<org.w3c.dom.Element> referenceParameters,
@Nullable
java.util.List<org.w3c.dom.Element> elements,
@Nullable
java.util.Map<javax.xml.namespace.QName,java.lang.String> attributes)
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
java.net.URI newAddress)
createWithAddress(String)
@NotNull
public WSEndpointReference createWithAddress(@NotNull
java.net.URL newAddress)
createWithAddress(String)
@NotNull
public WSEndpointReference createWithAddress(@NotNull
java.lang.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(java.lang.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
java.lang.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
java.lang.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<java.lang.Object> createDispatch(@NotNull
javax.xml.ws.Service jaxwsService,
@NotNull
javax.xml.bind.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 java.lang.String getAddress()
public boolean isAnonymous()
address.
public boolean isNone()
none URI
as the address.
public javax.xml.stream.XMLStreamReader read(@NotNull
java.lang.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 javax.xml.transform.Source asSource(@NotNull
java.lang.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
java.lang.String localName,
org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ErrorHandler errorHandler,
boolean fragment)
throws org.xml.sax.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.
org.xml.sax.SAXException
public void writeTo(@NotNull
java.lang.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.XMLStreamExceptionpublic Header createHeader(javax.xml.namespace.QName rootTagName)
Header that wraps this WSEndpointReference.
The returned header is immutable too, and can be reused with
many Messages.
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 addReferenceParametersToList(HeaderList outbound)
HeaderList.
public void addReferenceParametersToList(MessageHeaders outbound)
MessageHeaders.
public void addReferenceParameters(HeaderList headers)
HeaderList
to this EPR
public java.lang.String toString()
toString in class java.lang.Objectpublic javax.xml.namespace.QName getName()
getName in interface WSDLExtension
@Nullable
public WSEndpointReference.EPRExtension getEPRExtension(javax.xml.namespace.QName extnQName)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
@NotNull
public java.util.Collection<WSEndpointReference.EPRExtension> getEPRExtensions()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException@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 | |||||||||