- java.lang.Object
-
- javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder
-
public final class W3CEndpointReferenceBuilder extends Object
此类用于构建W3CEndpointReference实例。 此clsss的预期用途是为应用程序组件(例如工厂组件)为同一Java EE应用程序发布的Web服务端点创建一个W3CEndpointReference。 它还可以用于通过提供address属性为基于Java SE的端点创建W3CEndpointReferences。为未由同一Java EE应用程序发布的端点创建
W3CEndpointReference,必须指定address属性。为同一Java EE应用程序发布的端点创建
W3CEndpointReference,address属性可能为null但serviceName和endpointName必须指定由同一Java EE应用程序发布的端点。当指定了
wsdlDocumentLocation时,它必须参考有效的WSDL文档,而serviceName和endpointName(如果指定)必须匹配WSDL文档中的服务和端口。- 从以下版本开始:
- 1.6,JAX-WS 2.1
-
-
构造方法摘要
构造方法 Constructor 描述 W3CEndpointReferenceBuilder()创建一个新的W3CEndpointReferenceBuilder实例。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 W3CEndpointReferenceBuilderaddress(String address)设置address至W3CEndpointReference实例的wsa:Address。W3CEndpointReferenceBuilderattribute(QName name, String value)向W3CEndpointReference实例的wsa:EndpointReference元素添加扩展属性。W3CEndpointReferencebuild()根据此W3CEndpointReferenceBuilder实例设置的累积属性构建一个W3CEndpointReference。W3CEndpointReferenceBuilderelement(Element element)向W3CEndpointReference实例的wsa:EndpointReference元素添加一个扩展元素。W3CEndpointReferenceBuilderendpointName(QName endpointName)设置endpointName为wsam:ServiceName/@EndpointName的wsa:Metadata元素。W3CEndpointReferenceBuilderinterfaceName(QName interfaceName)将interfaceName设置为wsam:InterfaceName元素中的wsa:Metadata元素。W3CEndpointReferenceBuildermetadata(Element metadataElement)将metadataElement添加到W3CEndpointReference实例的wsa:Metadata元素中。W3CEndpointReferenceBuilderreferenceParameter(Element referenceParameter)将referenceParameter添加到W3CEndpointReference实例wsa:ReferenceParameters元素。W3CEndpointReferenceBuilderserviceName(QName serviceName)将serviceName设为wsam:ServiceName元素中的wsa:Metadata元素。W3CEndpointReferenceBuilderwsdlDocumentLocation(String wsdlDocumentLocation)设置wsdlDocumentLocation,将作为被引用wsa:Metadata/@wsdli:wsdlLocation。
-
-
-
方法详细信息
-
address
public W3CEndpointReferenceBuilder address(String address)
设置address至W3CEndpointReference实例的wsa:Address。当为未由同一Java EE应用程序发布的Web服务端点构建
W3CEndpointReference或在Java SE上运行时,address必须设置为非null值。- 参数
-
address- 返回的W3CEndpointReference要定位的端点的地址。 - 结果
-
一个
W3CEndpointReferenceBuilder实例与address设置为wsa:Address。
-
interfaceName
public W3CEndpointReferenceBuilder interfaceName(QName interfaceName)
设置interfaceName为wsam:InterfaceName的元素wsa:Metadata元素。 详见2.1 Referencing WSDL Metadata from an EPR 。- 参数
-
interfaceName- 返回的W3CEndpointReference要定位的端点的端口类型名称。 - 结果
-
A
W3CEndpointReferenceBuilder实例用interfaceName作为wsam:InterfaceName元素添加到wsa:Metadata元素 - 从以下版本开始:
- 1.7
-
serviceName
public W3CEndpointReferenceBuilder serviceName(QName serviceName)
在wsam:ServiceName元素中设置serviceName为wsa:Metadata元素。 详见2.1 Referencing WSDL Metadata from an EPR 。- 参数
-
serviceName- 返回的W3CEndpointReference要定位的端点的服务名称。 此属性也可以与endpointName(portName)属性一起使用,以查找由同一Java EE应用程序发布的Web服务端点的address。 - 结果
-
A
W3CEndpointReferenceBuilder实例与serviceName作为wsam:ServiceName元素添加到wsa:Metadata元素
-
endpointName
public W3CEndpointReferenceBuilder endpointName(QName endpointName)
设置endpointName为wsam:ServiceName/@EndpointName的wsa:Metadata元素。 此方法只能在调用serviceName方法后调用。- 参数
-
endpointName- 返回的W3CEndpointReference要定位的端点的名称。endpointName(portName)属性也可以与serviceName属性一起使用,以查找同一Java EE应用程序发布的Web服务端点的address。 - 结果
-
A
W3CEndpointReferenceBuilder实例中的endpointName作为wsam:ServiceName/@EndpointName在wsa:Metadata元素中。 - 异常
-
IllegalStateException- 如果serviceName尚未设置 -
IllegalArgumentException- 如果endpointName的命名空间URI不符合serviceName的命名空间URI
-
wsdlDocumentLocation
public W3CEndpointReferenceBuilder wsdlDocumentLocation(String wsdlDocumentLocation)
设置wsdlDocumentLocation,将作为被引用wsa:Metadata/@wsdli:wsdlLocation。 wsdli:wsdlLocation的值的命名空间名称可以从WSDL本身获取。- 参数
-
wsdlDocumentLocation- 要在wsa:Metadata的W3CEndpointReference引用的WSDL文档的位置。 - 结果
-
一个
W3CEndpointReferenceBuilder实例与要引用的wsdlDocumentLocation。
-
referenceParameter
public W3CEndpointReferenceBuilder referenceParameter(Element referenceParameter)
将referenceParameter添加到W3CEndpointReference实例wsa:ReferenceParameters元素。- 参数
-
referenceParameter- 要添加到wsa:ReferenceParameters元素的元素。 - 结果
-
一个
W3CEndpointReferenceBuilder实例与referenceParameter添加到wsa:ReferenceParameters元素。 - 异常
-
IllegalArgumentException- 如果referenceParameter是null。
-
metadata
public W3CEndpointReferenceBuilder metadata(Element metadataElement)
将metadataElement添加到W3CEndpointReference实例的wsa:Metadata元素中。- 参数
-
metadataElement- 要添加到wsa:Metadata元素的元素。 - 结果
-
一个
W3CEndpointReferenceBuilder实例与metadataElement添加到wsa:Metadata元素。 - 异常
-
IllegalArgumentException- 如果metadataElement是null。
-
element
public W3CEndpointReferenceBuilder element(Element element)
在W3CEndpointReference实例的wsa:EndpointReference元素中添加一个扩展元素。- 参数
-
element- 要添加到W3CEndpointReference的扩展元素 - 结果
-
一个
W3CEndpointReferenceBuilder实例,扩展名为element添加到W3CEndpointReference实例。 - 异常
-
IllegalArgumentException- 如果element是null。 - 从以下版本开始:
- 1.7,JAX-WS 2.2
-
attribute
public W3CEndpointReferenceBuilder attribute(QName name, String value)
向W3CEndpointReference实例的wsa:EndpointReference元素添加扩展属性。- 参数
-
name- 要添加到W3CEndpointReference的扩展名属性的W3CEndpointReference -
value- 扩展属性值 - 结果
-
一个
W3CEndpointReferenceBuilder实例与扩展属性添加到W3CEndpointReference实例。 - 异常
-
IllegalArgumentException- 如果name或value是null。 - 从以下版本开始:
- 1.7,JAX-WS 2.2
-
build
public W3CEndpointReference build()
根据这个W3CEndpointReferenceBuilder实例设置的累积属性构建一个W3CEndpointReference。通过指定
address属性以及任何其他所需的属性,此方法可用于为任何端点创建一个W3CEndpointReference。 此方法也可用于为同一Java EE应用程序发布的端点创建一个W3CEndpointReference。 这种方法可以自动判断address由被识别的同一Java EE应用程序发布端点的serviceName和endpointName性能。 如果address是null,而serviceName和endpointName没有标识同一Java EE应用程序发布的端点,java.lang.IllegalStateException必须抛出一个java.lang.IllegalStateException。- 结果
-
W3CEndpointReference从这个W3CEndpointReferenceBuilder实例中设置的累积属性。 此方法从不返回null。 - 异常
-
IllegalStateException-- 如果
address,serviceName和endpointName都是null。 - 如果
serviceName服务是null,而endpointName不是null。 - 如果
address属性为null,并且serviceName和endpointName未指定由同一Java EE应用程序发布的有效端点。 - 如果
serviceName不是null,并且不在指定的WSDL中。 - 如果
endpointName端口不是null并且它不存在于WSDL中的serviceName服务中。 - 如果
wsdlDocumentLocation不是null,并不代表有效的WSDL。
- 如果
-
WebServiceException- If an error occurs while creating theW3CEndpointReference.
-
-