Class W3CEndpointReferenceBuilder
- java.lang.Object
-
- javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder
public final class W3CEndpointReferenceBuilder extends Object
This class is used to build 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 Java 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 Java EE application, the address property MUST be specified.
When creating a W3CEndpointReference for an endpoint published by the same Java EE application, the address property MAY be null but then the serviceName and endpointName MUST specify an endpoint published by the same Java 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:
- JAX-WS 2.1
Constructors
| Constructor and Description |
|---|
W3CEndpointReferenceBuilder() Creates a new |
Methods
| Modifier and Type | Method and Description |
|---|---|
W3CEndpointReferenceBuilder |
address(String address) Sets the |
W3CEndpointReferenceBuilder |
attribute(QName name,
String value) Adds an extension attribute to the |
W3CEndpointReference |
build() Builds a |
W3CEndpointReferenceBuilder |
element(Element element) Adds an extension element to the |
W3CEndpointReferenceBuilder |
endpointName(QName endpointName) Sets the |
W3CEndpointReferenceBuilder |
interfaceName(QName interfaceName) Sets the |
W3CEndpointReferenceBuilder |
metadata(Element metadataElement) Adds the |
W3CEndpointReferenceBuilder |
referenceParameter(Element referenceParameter) Adds the |
W3CEndpointReferenceBuilder |
serviceName(QName serviceName) Sets the |
W3CEndpointReferenceBuilder |
wsdlDocumentLocation(String wsdlDocumentLocation) Sets the |
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Constructors
W3CEndpointReferenceBuilder
public W3CEndpointReferenceBuilder()
Creates a new W3CEndpointReferenceBuilder instance.
Methods
address
public W3CEndpointReferenceBuilder address(String address)
Sets the address to the W3CEndpointReference instance's wsa:Address.
The address MUST be set to a non-null value when building a W3CEndpointReference for a web service endpoint that is not published by the same Java 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
public W3CEndpointReferenceBuilder interfaceName(QName interfaceName)
Sets the interfaceName as the wsam:InterfaceName element in the wsa:Metadata element. 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
serviceName
public W3CEndpointReferenceBuilder serviceName(QName serviceName)
Sets the serviceName as the wsam:ServiceName element in the wsa:Metadata element. 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 Java EE application. - Returns:
- A
W3CEndpointReferenceBuilderinstance with theserviceNameaswsam:ServiceNameelement added to thewsa:Metadataelement
endpointName
public W3CEndpointReferenceBuilder endpointName(QName endpointName)
Sets the endpointName as wsam:ServiceName/@EndpointName in the wsa:Metadata element. This method can only be called after the serviceName 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 Java EE application. - Returns:
- A
W3CEndpointReferenceBuilderinstance with theendpointNameaswsam:ServiceName/@EndpointNamein thewsa:Metadataelement. - Throws:
-
IllegalStateException,- if theserviceNamehas not been set. -
IllegalArgumentException,- if theendpointName's Namespace URI doesn't matchserviceName's Namespace URI
wsdlDocumentLocation
public W3CEndpointReferenceBuilder wsdlDocumentLocation(String wsdlDocumentLocation)
Sets the wsdlDocumentLocation that will be referenced as wsa: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
public W3CEndpointReferenceBuilder referenceParameter(Element referenceParameter)
Adds the referenceParameter to the W3CEndpointReference instance wsa:ReferenceParameters element.
- Parameters:
-
referenceParameter- The element to be added to thewsa:ReferenceParameterselement. - Returns:
- A
W3CEndpointReferenceBuilderinstance with thereferenceParameteradded to thewsa:ReferenceParameterselement. - Throws:
-
IllegalArgumentException- ifreferenceParameterisnull.
metadata
public W3CEndpointReferenceBuilder metadata(Element metadataElement)
Adds the metadataElement to the W3CEndpointReference instance's wsa:Metadata element.
- Parameters:
-
metadataElement- The element to be added to thewsa:Metadataelement. - Returns:
- A
W3CEndpointReferenceBuilderinstance with themetadataElementadded to thewsa:Metadataelement. - Throws:
-
IllegalArgumentException- ifmetadataElementisnull.
element
public W3CEndpointReferenceBuilder element(Element element)
Adds an extension element to the W3CEndpointReference instance's wsa:EndpointReference element.
- Parameters:
-
element- The extension element to be added to theW3CEndpointReference - Returns:
- A
W3CEndpointReferenceBuilderinstance with the extensionelementadded to theW3CEndpointReferenceinstance. - Throws:
-
IllegalArgumentException- ifelementisnull. - Since:
- JAX-WS 2.2
attribute
public W3CEndpointReferenceBuilder attribute(QName name,
String value) Adds an extension attribute to the W3CEndpointReference instance's wsa:EndpointReference element.
- Parameters:
-
name- The name of the extension attribute to be added to theW3CEndpointReference -
value- extension attribute value - Returns:
- A
W3CEndpointReferenceBuilderinstance with the extension attribute added to theW3CEndpointReferenceinstance. - Throws:
-
IllegalArgumentException- ifnameorvalueisnull. - Since:
- JAX-WS 2.2
build
public W3CEndpointReference build()
Builds a W3CEndpointReference from the accumulated properties set on this W3CEndpointReferenceBuilder instance.
This method can be used to create a W3CEndpointReference for any endpoint by specifying the address property along with any other desired properties. This method can also be used to create a W3CEndpointReference for an endpoint that is published by the same Java EE application. This method can automatically determine the address of an endpoint published by the same Java EE application that is identified by the serviceName and endpointName properties. If the address is null and the serviceName and endpointName do not identify an endpoint published by the same Java EE application, a java.lang.IllegalStateException MUST 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 Java 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.
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/javase/8/docs/api/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.html