Class W3CEndpointReferenceBuilder
W3CEndpointReference
instances. The intended use of this clsss is for
an application component, for example a factory component,
to create an W3CEndpointReference for a
web service endpoint published by the same
Jakarta EE application. It can also be used to create
W3CEndpointReferences for an Java SE based
endpoint by providing the address property.
When creating a W3CEndpointReference for an
endpoint that is not published by the same Jakarta EE application,
the address property MUST be specified.
When creating a W3CEndpointReference for an endpoint
published by the same Jakarta EE application, the address
property MAY be null but then the serviceName
and endpointName MUST specify an endpoint published by
the same Jakarta EE application.
When the wsdlDocumentLocation is specified it MUST refer
to a valid WSDL document and the serviceName and
endpointName (if specified) MUST match a service and port
in the WSDL document.
- Since:
- 1.6, JAX-WS 2.1
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newW3CEndpointReferenceBuilderinstance. -
Method Summary
Modifier and TypeMethodDescriptionSets theaddressto theW3CEndpointReferenceinstance'swsa:Address.Adds an extension attribute to theW3CEndpointReferenceinstance'swsa:EndpointReferenceelement.build()Builds aW3CEndpointReferencefrom the accumulated properties set on thisW3CEndpointReferenceBuilderinstance.Adds an extension element to theW3CEndpointReferenceinstance'swsa:EndpointReferenceelement.endpointName(QName endpointName) Sets theendpointNameaswsam:ServiceName/@EndpointNamein thewsa:Metadataelement.interfaceName(QName interfaceName) Sets theinterfaceNameas thewsam:InterfaceNameelement in thewsa:Metadataelement.Adds themetadataElementto theW3CEndpointReferenceinstance'swsa:Metadataelement.referenceParameter(Element referenceParameter) Adds thereferenceParameterto theW3CEndpointReferenceinstancewsa:ReferenceParameterselement.serviceName(QName serviceName) Sets theserviceNameas thewsam:ServiceNameelement in thewsa:Metadataelement.wsdlDocumentLocation(String wsdlDocumentLocation) Sets thewsdlDocumentLocationthat will be referenced aswsa:Metadata/@wsdli:wsdlLocation.
-
Constructor Details
-
W3CEndpointReferenceBuilder
public W3CEndpointReferenceBuilder()Creates a newW3CEndpointReferenceBuilderinstance.
-
-
Method Details
-
address
Sets theaddressto theW3CEndpointReferenceinstance'swsa:Address.The
addressMUST be set to a non-nullvalue when building aW3CEndpointReferencefor a web service endpoint that is not published by the same Jakarta EE application or when running on Java SE.- Parameters:
address- The address of the endpoint to be targeted by the returnedW3CEndpointReference.- Returns:
- A
W3CEndpointReferenceBuilderinstance with theaddressset to thewsa:Address.
-
interfaceName
Sets theinterfaceNameas thewsam:InterfaceNameelement in thewsa:Metadataelement. See 2.1 Referencing WSDL Metadata from an EPR for more details.- Parameters:
interfaceName- The port type name of the endpoint to be targeted by the returnedW3CEndpointReference.- Returns:
- A
W3CEndpointReferenceBuilderinstance with theinterfaceNameaswsam:InterfaceNameelement added to thewsa:Metadataelement - Since:
- 1.7
-
serviceName
Sets theserviceNameas thewsam:ServiceNameelement in thewsa:Metadataelement. See 2.1 Referencing WSDL Metadata from an EPR for more details.- Parameters:
serviceName- The service name of the endpoint to be targeted by the returnedW3CEndpointReference. This property may also be used with theendpointName(portName) property to lookup theaddressof a web service endpoint that is published by the same Jakarta EE application.- Returns:
- A
W3CEndpointReferenceBuilderinstance with theserviceNameaswsam:ServiceNameelement added to thewsa:Metadataelement
-
endpointName
Sets theendpointNameaswsam:ServiceName/@EndpointNamein thewsa:Metadataelement. This method can only be called after theserviceName(QName)method has been called.See 2.1 Referencing WSDL Metadata from an EPR for more details.
- Parameters:
endpointName- The name of the endpoint to be targeted by the returnedW3CEndpointReference. TheendpointName(portName) property may also be used with theserviceNameproperty to lookup theaddressof a web service endpoint published by the same Jakarta EE application.- Returns:
- A
W3CEndpointReferenceBuilderinstance with theendpointNameaswsam:ServiceName/@EndpointNamein thewsa:Metadataelement. - Throws:
IllegalStateException- if theserviceNamehas not been setIllegalArgumentException- if theendpointName's Namespace URI doesn't matchserviceName's Namespace URI
-
wsdlDocumentLocation
Sets thewsdlDocumentLocationthat will be referenced aswsa:Metadata/@wsdli:wsdlLocation. The namespace name for the wsdli:wsdlLocation's value can be taken from the WSDL itself.See 2.1 Referencing WSDL Metadata from an EPR for more details.
- Parameters:
wsdlDocumentLocation- The location of the WSDL document to be referenced in thewsa:Metadataof theW3CEndpointReference.- Returns:
- A
W3CEndpointReferenceBuilderinstance with thewsdlDocumentLocationthat is to be referenced.
-
referenceParameter
Adds thereferenceParameterto theW3CEndpointReferenceinstancewsa:ReferenceParameterselement.- Parameters:
referenceParameter- The element to be added to thewsa:ReferenceParameterselement.- Returns:
- A
W3CEndpointReferenceBuilderinstance with thereferenceParameteradded to thewsa:ReferenceParameterselement. - Throws:
IllegalArgumentException- ifreferenceParameterisnull.
-
metadata
Adds themetadataElementto theW3CEndpointReferenceinstance'swsa:Metadataelement.- Parameters:
metadataElement- The element to be added to thewsa:Metadataelement.- Returns:
- A
W3CEndpointReferenceBuilderinstance with themetadataElementadded to thewsa:Metadataelement. - Throws:
IllegalArgumentException- ifmetadataElementisnull.
-
element
Adds an extension element to theW3CEndpointReferenceinstance'swsa:EndpointReferenceelement.- Parameters:
element- The extension element to be added to theW3CEndpointReference- Returns:
- A
W3CEndpointReferenceBuilderinstance with the extensionelementadded to theW3CEndpointReferenceinstance. - Throws:
IllegalArgumentException- ifelementisnull.- Since:
- 1.7, JAX-WS 2.2
-
attribute
Adds an extension attribute to theW3CEndpointReferenceinstance'swsa:EndpointReferenceelement.- Parameters:
name- The name of the extension attribute to be added to theW3CEndpointReferencevalue- extension attribute value- Returns:
- A
W3CEndpointReferenceBuilderinstance with the extension attribute added to theW3CEndpointReferenceinstance. - Throws:
IllegalArgumentException- ifnameorvalueisnull.- Since:
- 1.7, JAX-WS 2.2
-
build
Builds aW3CEndpointReferencefrom the accumulated properties set on thisW3CEndpointReferenceBuilderinstance.This method can be used to create a
W3CEndpointReferencefor any endpoint by specifying theaddressproperty along with any other desired properties. This method can also be used to create aW3CEndpointReferencefor an endpoint that is published by the same Jakarta EE application. This method can automatically determine theaddressof an endpoint published by the same Jakarta EE application that is identified by theserviceNameandendpointNameproperties. If theaddressisnulland theserviceNameandendpointNamedo not identify an endpoint published by the same Jakarta EE application, ajava.lang.IllegalStateExceptionMUST be thrown.- Returns:
W3CEndpointReferencefrom the accumulated properties set on thisW3CEndpointReferenceBuilderinstance. This method never returnsnull.- Throws:
IllegalStateException-- If the
address,serviceNameandendpointNameare allnull. - If the
serviceNameservice isnulland theendpointNameis NOTnull. - If the
addressproperty isnulland theserviceNameandendpointNamedo not specify a valid endpoint published by the same Jakarta EE application. - If the
serviceNameis NOTnulland is not present in the specified WSDL. - If the
endpointNameport is notnulland it is not present inserviceNameservice in the WSDL. - If the
wsdlDocumentLocationis NOTnulland does not represent a valid WSDL.
- If the
WebServiceException- If an error occurs while creating theW3CEndpointReference.
-