Top Description Fields Constructors Methods
javax.xml.ws.wsaddressing

public final Class W3CEndpointReferenceBuilder

extends Object
Class Inheritance
Imports
org.w3c.dom.Element, java.util.ArrayList, .List, .Map, .HashMap, javax.xml.namespace.QName, javax.xml.ws.WebServiceException, javax.xml.ws.spi.Provider

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
1.6, JAX-WS 2.1

Field Summary

Modifier and TypeField and Description
private String
private Map<QName, String>
private List<Element>
private QName
private QName
private List<Element>
private List<Element>
private QName
private String

Constructor Summary

AccessConstructor and Description
public
W3CEndpointReferenceBuilder()

Creates a new W3CEndpointReferenceBuilder instance.

Method Summary

Modifier and TypeMethod and Description
public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the address set to the wsa:Address.
address
(String
The address of the endpoint to be targeted by the returned W3CEndpointReference.
address
)

Sets the address to the W3CEndpointReference instance's wsa:Address.

public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the extension attribute added to the W3CEndpointReference instance.
attribute
(QName
The name of the extension attribute to be added to the W3CEndpointReference
name
,
String
extension attribute value
value
)

Adds an extension attribute to the W3CEndpointReference instance's wsa:EndpointReference element.

public W3CEndpointReference

Returns:

W3CEndpointReference from the accumulated properties set on this W3CEndpointReferenceBuilder instance. This method never returns null.
build
()

Builds a W3CEndpointReference from the accumulated properties set on this W3CEndpointReferenceBuilder instance.

public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the extension element added to the W3CEndpointReference instance.
element
(Element
The extension element to be added to the W3CEndpointReference
element
)

Adds an extension element to the W3CEndpointReference instance's wsa:EndpointReference element.

public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the endpointName as wsam:ServiceName/@EndpointName in the wsa:Metadata element.
endpointName
(QName
The name of the endpoint to be targeted by the returned W3CEndpointReference. The endpointName (portName) property may also be used with the serviceName property to lookup the address of a web service endpoint published by the same Java EE application.
endpointName
)

Sets the endpointName as wsam:ServiceName/@EndpointName in the wsa:Metadata element.

public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the interfaceName as wsam:InterfaceName element added to the wsa:Metadata element
interfaceName
(QName
The port type name of the endpoint to be targeted by the returned W3CEndpointReference.
interfaceName
)

Sets the interfaceName as the wsam:InterfaceName element in the wsa:Metadata element.

public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the metadataElement added to the wsa:Metadata element.
metadata
(Element
The element to be added to the wsa:Metadata element.
metadataElement
)

Adds the metadataElement to the W3CEndpointReference instance's wsa:Metadata element.

public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the referenceParameter added to the wsa:ReferenceParameters element.
referenceParameter
(Element
The element to be added to the wsa:ReferenceParameters element.
referenceParameter
)

Adds the referenceParameter to the W3CEndpointReference instance wsa:ReferenceParameters element.

public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the serviceName as wsam:ServiceName element added to the wsa:Metadata element
serviceName
(QName
The service name of the endpoint to be targeted by the returned W3CEndpointReference. This property may also be used with the endpointName (portName) property to lookup the address of a web service endpoint that is published by the same Java EE application.
serviceName
)

Sets the serviceName as the wsam:ServiceName element in the wsa:Metadata element.

public W3CEndpointReferenceBuilder

Returns:

A W3CEndpointReferenceBuilder instance with the wsdlDocumentLocation that is to be referenced.
wsdlDocumentLocation
(String
The location of the WSDL document to be referenced in the wsa:Metadata of the W3CEndpointReference.
wsdlDocumentLocation
)

Sets the wsdlDocumentLocation that will be referenced as wsa:Metadata/@wsdli:wsdlLocation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addressback to summary
private String address
attributesback to summary
private Map<QName, String> attributes
elementsback to summary
private List<Element> elements
endpointNameback to summary
private QName endpointName
interfaceNameback to summary
private QName interfaceName
metadataback to summary
private List<Element> metadata
referenceParametersback to summary
private List<Element> referenceParameters
serviceNameback to summary
private QName serviceName
wsdlDocumentLocationback to summary
private String wsdlDocumentLocation

Constructor Detail

W3CEndpointReferenceBuilderback to summary
public W3CEndpointReferenceBuilder()

Creates a new W3CEndpointReferenceBuilder instance.

Method Detail

addressback to summary
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:String

The address of the endpoint to be targeted by the returned W3CEndpointReference.

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the address set to the wsa:Address.

attributeback to summary
public W3CEndpointReferenceBuilder attribute(QName name, String value)

Adds an extension attribute to the W3CEndpointReference instance's wsa:EndpointReference element.

Parameters
name:QName

The name of the extension attribute to be added to the W3CEndpointReference

value:String

extension attribute value

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the extension attribute added to the W3CEndpointReference instance.

Exceptions
IllegalArgumentException:
if name or value is null.
Since
1.7, JAX-WS 2.2
buildback to summary
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:W3CEndpointReference

W3CEndpointReference from the accumulated properties set on this W3CEndpointReferenceBuilder instance. This method never returns null.

Exceptions
IllegalStateException:
  • If the address, serviceName and endpointName are all null.
  • If the serviceName service is null and the endpointName is NOT null.
  • If the address property is null and the serviceName and endpointName do not specify a valid endpoint published by the same Java EE application.
  • If the serviceName is NOT null and is not present in the specified WSDL.
  • If the endpointName port is not null and it is not present in serviceName service in the WSDL.
  • If the wsdlDocumentLocation is NOT null and does not represent a valid WSDL.
WebServiceException:
If an error occurs while creating the W3CEndpointReference.
elementback to summary
public W3CEndpointReferenceBuilder element(Element element)

Adds an extension element to the W3CEndpointReference instance's wsa:EndpointReference element.

Parameters
element:Element

The extension element to be added to the W3CEndpointReference

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the extension element added to the W3CEndpointReference instance.

Exceptions
IllegalArgumentException:
if element is null.
Since
1.7, JAX-WS 2.2
endpointNameback to summary
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(QName) method has been called.

See 2.1 Referencing WSDL Metadata from an EPR for more details.

Parameters
endpointName:QName

The name of the endpoint to be targeted by the returned W3CEndpointReference. The endpointName (portName) property may also be used with the serviceName property to lookup the address of a web service endpoint published by the same Java EE application.

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the endpointName as wsam:ServiceName/@EndpointName in the wsa:Metadata element.

Exceptions
IllegalStateException:
if the serviceName has not been set
IllegalArgumentException:
if the endpointName's Namespace URI doesn't match serviceName's Namespace URI
interfaceNameback to summary
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:QName

The port type name of the endpoint to be targeted by the returned W3CEndpointReference.

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the interfaceName as wsam:InterfaceName element added to the wsa:Metadata element

Since
1.7
metadataback to summary
public W3CEndpointReferenceBuilder metadata(Element metadataElement)

Adds the metadataElement to the W3CEndpointReference instance's wsa:Metadata element.

Parameters
metadataElement:Element

The element to be added to the wsa:Metadata element.

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the metadataElement added to the wsa:Metadata element.

Exceptions
IllegalArgumentException:
if metadataElement is null.
referenceParameterback to summary
public W3CEndpointReferenceBuilder referenceParameter(Element referenceParameter)

Adds the referenceParameter to the W3CEndpointReference instance wsa:ReferenceParameters element.

Parameters
referenceParameter:Element

The element to be added to the wsa:ReferenceParameters element.

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the referenceParameter added to the wsa:ReferenceParameters element.

Exceptions
IllegalArgumentException:
if referenceParameter is null.
serviceNameback to summary
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:QName

The service name of the endpoint to be targeted by the returned W3CEndpointReference. This property may also be used with the endpointName (portName) property to lookup the address of a web service endpoint that is published by the same Java EE application.

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the serviceName as wsam:ServiceName element added to the wsa:Metadata element

wsdlDocumentLocationback to summary
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:String

The location of the WSDL document to be referenced in the wsa:Metadata of the W3CEndpointReference.

Returns:W3CEndpointReferenceBuilder

A W3CEndpointReferenceBuilder instance with the wsdlDocumentLocation that is to be referenced.