public final class AddressingFeature extends WebServiceFeature
此功能可SEI代理的创建过程中使用的,和Dispatch
实例在客户端和服务器端Endpoint
实例。此功能不可用于Service
实例创建在客户端。
以下介绍了该功能的影响,将启用或禁用:
如果启用该功能,在required
属性确定端点需要寻址。如果设为true,寻址标题必须对传入和传出的消息是。默认情况下,required
属性false
。
如果Web服务开发者没有明确启用此功能,WSDL的方便寻址策略断言是用来发现WS-Addressing使用。采用特征明确,应用重写的WS-Addressing使用WSDL的指示。在某些情况下,这是真的需要的。例如,如果一个应用程序实现了寻址本身,它可以使用此功能来禁用寻址。这意味着JAX-WS实现不消耗或产生寻址标头。
如果启用了相应处理,方便寻址策略断言必须产生的WSDL中每 3.1 WS-Policy Assertions
在生成的WSDL @Addressing
例1:possible政策主张
<方便寻址wsp:可选=“true”> WSP:政策/ > << /方便寻址> 方便寻址wsp:可选=“true”>
在生成的WSDL @Addressing(required=true)
例2:possible政策主张
<地址> 方便WSP:政策/ > << /方便寻址> 地址>
在生成的WSDL @Addressing(required=true, responses=Responses.ANONYMOUS)
例3:possible政策主张
<地址> 方便WSP:< <政策> >基于anonymousresponses / >:<< / WSP:政策>< /方便寻址> 政策> 地址>
看到 Web Services Addressing - Core, Web Services Addressing 1.0 - SOAP Binding,和基于WS-Addressing的更多信息 Web Services Addressing 1.0 - Metadata。
Addressing
Modifier and Type | Class and Description |
---|---|
static class |
AddressingFeature.Responses
如果启用了寻址,此属性确定端点是否需要使用唯一的匿名响应,或只有非匿名的响应,或所有的。
|
Modifier and Type | Field and Description |
---|---|
static String |
ID
定值确定addressingfeature
|
protected boolean |
required
如果在启用,此属性确定是否需要WS-Addressing端点。
|
enabled
Constructor and Description |
---|
AddressingFeature()
创建和配置的要求使用一个
AddressingFeature 。
|
AddressingFeature(boolean enabled)
创建和配置的要求使用一个
AddressingFeature 。
|
AddressingFeature(boolean enabled, boolean required)
创建和配置的要求使用一个
AddressingFeature 。
|
AddressingFeature(boolean enabled, boolean required, AddressingFeature.Responses responses)
创建和配置的要求使用一个
AddressingFeature 。
|
Modifier and Type | Method and Description |
---|---|
String |
getID()
得到的唯一标识该webservicefeature。
|
AddressingFeature.Responses |
getResponses()
如果启用了寻址,此属性确定端点是否需要使用匿名响应,或非匿名响应,或所有响应。
|
boolean |
isRequired()
如果在启用,此属性确定是否需要WS-Addressing端点。
|
isEnabled
public static final String ID
protected boolean required
public AddressingFeature()
AddressingFeature
。创建功能使寻址即支持WS-Addressing但不需要。它也被配置为接受所有的响应类型。
public AddressingFeature(boolean enabled)
AddressingFeature
。如果
enabled
是真实的,它使寻址即支持WS-Addressing但不需要。它还配置为接受所有的反应类型。
enabled
真使i.e.ws-addressing WS-Addressing支持但不需要
public AddressingFeature(boolean enabled, boolean required)
AddressingFeature
。如果
enabled
和
required
是真实的,它使寻址和需要使用的。它还配置为接受所有的反应类型。
enabled
真使i.e.ws-addressing WS-Addressing支持但不需要
required
-真的意味着需要WS-Addressing使用。
public AddressingFeature(boolean enabled, boolean required, AddressingFeature.Responses responses)
AddressingFeature
。如果
enabled
和
required
是真实的,它使寻址和需要使用的。同时,响应类型可以配置使用
responses
参数。
enabled
真使i.e.ws-addressing WS-Addressing支持但不需要
required
-真的意味着需要WS-Addressing使用。
responses
-指定什么类型的反应是必需的
public String getID()
getID
方法重写,继承类
WebServiceFeature
public boolean isRequired()
public AddressingFeature.Responses getResponses()
AddressingFeature.Responses.ALL
当端点支持所有类型的反应时,
AddressingFeature.Responses.ANONYMOUS
端点要求只能使用匿名的反应时,
AddressingFeature.Responses.NON_ANONYMOUS
端点要求只能使用非匿名的反应
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.