- java.lang.Object
-
- jakarta.xml.ws.EndpointReference
-
- Direct Known Subclasses:
W3CEndpointReference
public abstract class EndpointReference extends Object
This class represents an WS-Addressing EndpointReference which is a remote reference to a web service endpoint. See Web Services Addressing 1.0 - Core for more information on WS-Addressing EndpointReferences.This class is immutable as the typical web service developer need not be concerned with its contents. The web service developer should use this class strictly as a mechanism to reference a remote web service endpoint. See the
ServiceAPIs that clients can use to that utilize anEndpointReference. See theEndpoint, andBindingProviderAPIs on howEndpointReferencescan be created for published endpoints.Concrete implementations of this class will represent an
EndpointReferencefor a particular version of Addressing. For example theW3CEndpointReferenceis for use with W3C Web Services Addressing 1.0 - Core Recommendation. If Jakarta XML Web Services implementors need to support different versions of addressing, they should write their ownEndpointReferencesubclass for that version. This will allow a Jakarta XML Web Services implementation to create a vendor specificEndpointReferencesthat the vendor can use to flag a different version of addressing.Web service developers that wish to pass or return
EndpointReferencein Java methods in an SEI should use concrete instances of anEndpointReferencesuch as theW3CEndpointReference. This way the schema mapped from the SEI will be more descriptive of the type of endpoint reference being passed.Jakarta XML Web Services implementors are expected to extract the XML infoset from an
EndpointRefereceusing thewriteTo(javax.xml.transform.Result)method.Jakarta XML Binding will bind this class to xs:anyType. If a better binding is desired, web services developers should use a concrete subclass such as
W3CEndpointReference.- See Also:
W3CEndpointReference,Service
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEndpointReference()Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T> TgetPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)ThegetPortmethod returns a proxy.static EndpointReferencereadFrom(Source eprInfoset)Factory method to read an EndpointReference from the infoset contained ineprInfoset.StringtoString()Displays EPR infoset for debugging convenience.abstract voidwriteTo(Result result)write thisEndpointReferenceto the specified infoset format
-
-
-
Method Detail
-
readFrom
public static EndpointReference readFrom(Source eprInfoset)
Factory method to read an EndpointReference from the infoset contained ineprInfoset. This method delegates to the vendor specific implementation of theProvider.readEndpointReference(javax.xml.transform.Source)method.- Parameters:
eprInfoset- TheEndpointReferenceinfoset to be unmarshalled- Returns:
- the EndpointReference unmarshalled from
eprInfosetnevernull - Throws:
WebServiceException- if an error occurs while creating theEndpointReferencefrom theeprInfosetIllegalArgumentException- if thenulleprInfosetvalue is given.
-
writeTo
public abstract void writeTo(Result result)
write thisEndpointReferenceto the specified infoset format- Parameters:
result- for writing infoset- Throws:
WebServiceException- if there is an error writing theEndpointReferenceto the specifiedresult.IllegalArgumentException- If thenullresultvalue is given.
-
getPort
public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)
ThegetPortmethod returns a proxy. If there are any reference parameters in theEndpointReferenceinstance, then those reference parameters MUST appear as SOAP headers, indicating them to be reference parameters, on all messages sent to the endpoint. The parameterserviceEndpointInterfacespecifies the service endpoint interface that is supported by the returned proxy. TheEndpointReferenceinstance specifies the endpoint that will be invoked by the returned proxy. In the implementation of this method, the Jakarta XML Web Services runtime system takes the responsibility of selecting a protocol binding (and a port) and configuring the proxy accordingly from the WSDL Metadata from thisEndpointReferenceor from annotations on theserviceEndpointInterface. For this method to successfully return a proxy, WSDL metadata MUST be available and theEndpointReferenceinstance MUST contain an implementation understoodserviceNamemetadata.Because this port is not created from a
Serviceobject, handlers will not automatically be configured, and theHandlerResolverandExecutorcannot be get or set for this port. TheBindingProvider().getBinding().setHandlerChain()method can be used to manually configure handlers for this port.- Type Parameters:
T- Service endpoint interface- Parameters:
serviceEndpointInterface- Service endpoint interfacefeatures- An array ofWebServiceFeaturesto configure on the proxy. Supported features not in thefeaturesparameter will have their default values.- Returns:
- Object Proxy instance that supports the specified service endpoint interface
- Throws:
WebServiceException-- If there is an error during creation of the proxy
- If there is any missing WSDL metadata as required by this method
- If this
endpointReferenceis invalid - If an illegal
serviceEndpointInterfaceis specified - If a feature is enabled that is not compatible with this port or is unsupported.
- See Also:
Proxy,WebServiceFeature
-
-