Top Description Inners Fields Constructors Methods
javax.xml.ws.soap

public final Class AddressingFeature

extends WebServiceFeature
Class Inheritance
Imports
javax.xml.ws.WebServiceFeature, .Endpoint, .Service

AddressingFeature represents the use of WS-Addressing with either the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding. Using this feature with any other binding is undefined.

This feature can be used during the creation of SEI proxy, and javax.xml.ws.Dispatch instances on the client side and Endpoint instances on the server side. This feature cannot be used for Service instance creation on the client side.

The following describes the effects of this feature with respect to be enabled or disabled:

If the feature is enabled, the required property determines whether the endpoint requires WS-Addressing. If it is set true, WS-Addressing headers MUST be present on incoming and outgoing messages. By default the required property is false.

If the web service developer has not explicitly enabled this feature, WSDL's wsam:Addressing policy assertion is used to find the use of WS-Addressing. By using the feature explicitly, an application overrides WSDL's indication of the use of WS-Addressing. In some cases, this is really required. For example, if an application has implemented WS-Addressing itself, it can use this feature to disable addressing. That means a JAX-WS implementation doesn't consume or produce WS-Addressing headers.

If addressing is enabled, a corresponding wsam:Addressing policy assertion must be generated in the WSDL as per 3.1 WS-Policy Assertions

Example 1: Possible Policy Assertion in the generated WSDL for @Addressing

 <wsam:Addressing wsp:Optional="true">
    <wsp:Policy/>
  </wsam:Addressing> 

Example 2: Possible Policy Assertion in the generated WSDL for @Addressing(required=true)

 <wsam:Addressing>
    <wsp:Policy/>
  </wsam:Addressing> 

Example 3: Possible Policy Assertion in the generated WSDL for @Addressing(required=true, responses=Responses.ANONYMOUS)

 <wsam:Addressing>
     <wsp:Policy>
       <wsam:AnonymousResponses/>
     </wsp:Policy>
  </wsam:Addressing> 

See Web Services Addressing - Core, Web Services Addressing 1.0 - SOAP Binding, and Web Services Addressing 1.0 - Metadata for more information on WS-Addressing.

Since
1.6, JAX-WS 2.1
See Also
Addressing

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
AddressingFeature.Responses

If addressing is enabled, this property determines if endpoint requires the use of only anonymous responses, or only non-anonymous responses, or all.

Field Summary

Modifier and TypeField and Description
public static final String
ID

Constant value identifying the AddressingFeature

protected boolean
required

If addressing is enabled, this property determines whether the endpoint requires WS-Addressing.

private final AddressingFeature.Responses
Inherited from javax.xml.ws.WebServiceFeature:
enabled

Constructor Summary

AccessConstructor and Description
public
AddressingFeature()

Creates and configures an AddressingFeature with the use of addressing requirements.

public
AddressingFeature(boolean
true enables ws-addressing i.e.ws-addressing is supported but doesn't require its use
enabled
)

Creates and configures an AddressingFeature with the use of addressing requirements.

public
AddressingFeature(boolean
true enables ws-addressing i.e.ws-addressing is supported but doesn't require its use
enabled
,
boolean
true means requires the use of ws-addressing .
required
)

Creates and configures an AddressingFeature with the use of addressing requirements.

public
AddressingFeature(boolean
true enables ws-addressing i.e.ws-addressing is supported but doesn't require its use
enabled
,
boolean
true means requires the use of ws-addressing .
required
,
AddressingFeature.Responses
specifies what type of responses are required
responses
)

Creates and configures an AddressingFeature with the use of addressing requirements.

Method Summary

Modifier and TypeMethod and Description
public String
getID()

Implements abstract javax.xml.ws.WebServiceFeature.getID.

Get the unique identifier for this WebServiceFeature.
public AddressingFeature.Responses

Returns:

Responses#ALL when endpoint supports all types of responses, Responses#ANONYMOUS when endpoint requires the use of only anonymous responses, Responses#NON_ANONYMOUS when endpoint requires the use of only non-anonymous responses
getResponses
()

If addressing is enabled, this property determines whether endpoint requires the use of anonymous responses, or non-anonymous responses, or all responses.

public boolean

Returns:

the current required value
isRequired
()

If addressing is enabled, this property determines whether the endpoint requires WS-Addressing.

Inherited from javax.xml.ws.WebServiceFeature:
isEnabled

Field Detail

IDback to summary
public static final String ID

Constant value identifying the AddressingFeature

requiredback to summary
protected boolean required

If addressing is enabled, this property determines whether the endpoint requires WS-Addressing. If required is true, WS-Addressing headers MUST be present on incoming and outgoing messages.

responsesback to summary
private final AddressingFeature.Responses responses

Constructor Detail

AddressingFeatureback to summary
public AddressingFeature()

Creates and configures an AddressingFeature with the use of addressing requirements. The created feature enables ws-addressing i.e. supports ws-addressing but doesn't require its use. It is also configured to accept all the response types.

AddressingFeatureback to summary
public AddressingFeature(boolean enabled)

Creates and configures an AddressingFeature with the use of addressing requirements. If enabled is true, it enables ws-addressing i.e. supports ws-addressing but doesn't require its use. It also configures to accept all the response types.

Parameters
enabled:boolean

true enables ws-addressing i.e.ws-addressing is supported but doesn't require its use

AddressingFeatureback to summary
public AddressingFeature(boolean enabled, boolean required)

Creates and configures an AddressingFeature with the use of addressing requirements. If enabled and required are true, it enables ws-addressing and requires its use. It also configures to accept all the response types.

Parameters
enabled:boolean

true enables ws-addressing i.e.ws-addressing is supported but doesn't require its use

required:boolean

true means requires the use of ws-addressing .

AddressingFeatureback to summary
public AddressingFeature(boolean enabled, boolean required, AddressingFeature.Responses responses)

Creates and configures an AddressingFeature with the use of addressing requirements. If enabled and required are true, it enables ws-addressing and requires its use. Also, the response types can be configured using responses parameter.

Parameters
enabled:boolean

true enables ws-addressing i.e.ws-addressing is supported but doesn't require its use

required:boolean

true means requires the use of ws-addressing .

responses:AddressingFeature.Responses

specifies what type of responses are required

Since
1.7, JAX-WS 2.2

Method Detail

getIDback to summary
public String getID()

Implements abstract javax.xml.ws.WebServiceFeature.getID.

Doc from javax.xml.ws.WebServiceFeature.getID.

Get the unique identifier for this WebServiceFeature.

Returns:String

the unique identifier for this feature.

getResponsesback to summary
public AddressingFeature.Responses getResponses()

If addressing is enabled, this property determines whether endpoint requires the use of anonymous responses, or non-anonymous responses, or all responses.

Returns:AddressingFeature.Responses

Responses#ALL when endpoint supports all types of responses, Responses#ANONYMOUS when endpoint requires the use of only anonymous responses, Responses#NON_ANONYMOUS when endpoint requires the use of only non-anonymous responses

Since
1.7, JAX-WS 2.2
isRequiredback to summary
public boolean isRequired()

If addressing is enabled, this property determines whether the endpoint requires WS-Addressing. If required is true, WS-Addressing headers MUST be present on incoming and outgoing messages.

Returns:boolean

the current required value

javax.xml.ws.soap back to summary

public final Enum AddressingFeature.Responses

extends Enum<AddressingFeature.Responses>
Class Inheritance

If addressing is enabled, this property determines if endpoint requires the use of only anonymous responses, or only non-anonymous responses, or all.

Responses#ALL supports all response types and this is the default value.

Responses#ANONYMOUS requires the use of only anonymous responses. It will result into wsam:AnonymousResponses nested assertion as specified in 3.1.2 AnonymousResponses Assertion in the generated WSDL.

Responses#NON_ANONYMOUS requires the use of only non-anonymous responses. It will result into wsam:NonAnonymousResponses nested assertion as specified in 3.1.3 NonAnonymousResponses Assertion in the generated WSDL.

Since
1.7, JAX-WS 2.2

Field Summary

Modifier and TypeField and Description
public static final AddressingFeature.Responses
ALL

Supports all response types and this is the default

public static final AddressingFeature.Responses
ANONYMOUS

Specifies the use of only anonymous responses.

public static final AddressingFeature.Responses
NON_ANONYMOUS

Specifies the use of only non-anonymous responses.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AddressingFeature.Responses
public static AddressingFeature.Responses[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALLback to summary
public static final AddressingFeature.Responses ALL

Supports all response types and this is the default

ANONYMOUSback to summary
public static final AddressingFeature.Responses ANONYMOUS

Specifies the use of only anonymous responses. It will result into wsam:AnonymousResponses nested assertion as specified in 3.1.2 AnonymousResponses Assertion in the generated WSDL.

NON_ANONYMOUSback to summary
public static final AddressingFeature.Responses NON_ANONYMOUS

Specifies the use of only non-anonymous responses. It will result into wsam:NonAnonymousResponses nested assertion as specified in 3.1.3 NonAnonymousResponses Assertion in the generated WSDL.

Constructor Detail

Responsesback to summary
private Responses()

Method Detail

valueOfback to summary
public static AddressingFeature.Responses valueOf(String name)
valuesback to summary
public static AddressingFeature.Responses[] values()