public final class W3CEndpointReferenceBuilder extends Object
W3CEndpointReference实例。
预期使用这个clsss的是为应用程序组件,例如工厂组件,创建一个W3CEndpointReference对于因同一Java EE应用程序发布的Web服务端点。
也可以通过提供address属性来为基于Java SE的端点创建W3CEndpointReferences 。
当创建一个W3CEndpointReference对于不是由同一个Java EE应用程序发布的一个端点,该address必须被指定的属性。
当创建一个W3CEndpointReference对于因同一Java EE应用程序发布的一个端点,该address属性可能null但随后serviceName和endpointName必须指定相同的Java EE应用程序发布的端点。
当指定wsdlDocumentLocation时,它必须参考有效的WSDL文档,并且serviceName和endpointName (如果指定)必须与WSDL文档中的服务和端口匹配。
| Constructor and Description |
|---|
W3CEndpointReferenceBuilder()
创建一个新的
W3CEndpointReferenceBuilder实例。
|
| Modifier and Type | Method and Description |
|---|---|
W3CEndpointReferenceBuilder |
address(String address)
将
address设置为
W3CEndpointReference实例的
wsa:Address 。
|
W3CEndpointReferenceBuilder |
attribute(QName name, String value)
将扩展属性添加到
W3CEndpointReference实例的
wsa:EndpointReference元素。
|
W3CEndpointReference |
build()
从此
W3CEndpointReferenceBuilder实例中设置的累积属性构建一个
W3CEndpointReference 。
|
W3CEndpointReferenceBuilder |
element(Element element)
在
W3CEndpointReference实例的
wsa:EndpointReference元素中添加一个
wsa:EndpointReference元素。
|
W3CEndpointReferenceBuilder |
endpointName(QName endpointName)
在
wsa:Metadata元素
endpointName设为
wsam:ServiceName/@EndpointName 。
|
W3CEndpointReferenceBuilder |
interfaceName(QName interfaceName)
将
interfaceName设置为
wsam:InterfaceName元素中的
wsa:Metadata元素。
|
W3CEndpointReferenceBuilder |
metadata(Element metadataElement)
将
metadataElement添加到
W3CEndpointReference实例的
wsa:Metadata元素。
|
W3CEndpointReferenceBuilder |
referenceParameter(Element referenceParameter)
将
referenceParameter添加到
W3CEndpointReference实例
wsa:ReferenceParameters元素。
|
W3CEndpointReferenceBuilder |
serviceName(QName serviceName)
将
serviceName设置为
wsam:ServiceName元素中的
wsa:Metadata元素。
|
W3CEndpointReferenceBuilder |
wsdlDocumentLocation(String wsdlDocumentLocation)
设置
wsdlDocumentLocation ,将作为被引用
wsa:Metadata/@wsdli:wsdlLocation 。
|
public W3CEndpointReferenceBuilder()
W3CEndpointReferenceBuilder实例。
public W3CEndpointReferenceBuilder address(String address)
address设置为W3CEndpointReference实例的wsa:Address 。
当构建不是由同一Java EE应用程序发布或在Java SE上运行的Web服务端点的W3CEndpointReference时, address必须设置为非null值。
address - 返回的
W3CEndpointReference要定位的端点的地址。
W3CEndpointReferenceBuilder实例与
address设置为
wsa:Address 。
public W3CEndpointReferenceBuilder interfaceName(QName interfaceName)
interfaceName设置为wsam:InterfaceName元素中的wsa:Metadata元素。
详见2.1 Referencing WSDL Metadata from an EPR 。
interfaceName - 返回的
W3CEndpointReference要定位的端点的端口类型名称。
W3CEndpointReferenceBuilder实例与
interfaceName作为
wsam:InterfaceName元素添加到
wsa:Metadata元素
public W3CEndpointReferenceBuilder serviceName(QName serviceName)
serviceName设置为wsam:ServiceName元素中的wsa:Metadata元素。
详见2.1 Referencing WSDL Metadata from an EPR 。
serviceName - 返回的W3CEndpointReference要定位的端点的服务名称。
这个属性也可以与使用endpointName (PORTNAME)属性来查找address由同一个Java EE应用程序发布的Web服务端点。
W3CEndpointReferenceBuilder实例与
serviceName作为
wsam:ServiceName元素添加到
wsa:Metadata元素
public W3CEndpointReferenceBuilder endpointName(QName endpointName)
endpointName设置为wsam:ServiceName/@EndpointName在wsa:Metadata元素中。
此方法只能在调用serviceName方法后调用。
endpointName - 返回的W3CEndpointReference要定位的端点的名称。
该endpointName (PORTNAME)特性也可与用于serviceName属性来查找address由同一个Java EE应用程序发布的Web服务端点。
W3CEndpointReferenceBuilder实例与
endpointName为
wsam:ServiceName/@EndpointName在
wsa:Metadata元素。
IllegalStateException, - 如果
serviceName尚未设置。
IllegalArgumentException, - 如果
endpointName的命名空间URI不匹配
serviceName的命名空间URI
public W3CEndpointReferenceBuilder wsdlDocumentLocation(String wsdlDocumentLocation)
wsdlDocumentLocation ,将作为被引用wsa:Metadata/@wsdli:wsdlLocation 。
wsdli:wsdlLocation的值的命名空间名称可以从WSDL本身获取。
wsdlDocumentLocation - 要引用的WSDL文档的位置
wsa:Metadata的
W3CEndpointReference 。
W3CEndpointReferenceBuilder与实例
wsdlDocumentLocation是被引用。
public W3CEndpointReferenceBuilder referenceParameter(Element referenceParameter)
referenceParameter添加到
W3CEndpointReference实例
wsa:ReferenceParameters元素。
referenceParameter - 要添加到
wsa:ReferenceParameters元素的元素。
W3CEndpointReferenceBuilder实例与
referenceParameter添加到
wsa:ReferenceParameters元素。
IllegalArgumentException - 如果
referenceParameter是
null 。
public W3CEndpointReferenceBuilder metadata(Element metadataElement)
metadataElement添加到
W3CEndpointReference实例的
wsa:Metadata元素。
metadataElement - 要添加到
wsa:Metadata元素的元素。
W3CEndpointReferenceBuilder实例与
metadataElement添加到
wsa:Metadata元素。
IllegalArgumentException - 如果
metadataElement是
null 。
public W3CEndpointReferenceBuilder element(Element element)
W3CEndpointReference实例的
wsa:EndpointReference元素。
element - 要添加到
W3CEndpointReference的扩展元素
W3CEndpointReferenceBuilder实例与扩展名
element添加到
W3CEndpointReference实例。
IllegalArgumentException - 如果
element是
null 。
public W3CEndpointReferenceBuilder attribute(QName name, String value)
W3CEndpointReference实例的
wsa:EndpointReference元素。
name - 要添加到
W3CEndpointReference
value - 扩展属性值
W3CEndpointReferenceBuilder实例与扩展属性添加到
W3CEndpointReference实例。
IllegalArgumentException - 如果
name或
value是
null 。
public W3CEndpointReference build()
W3CEndpointReferenceBuilder实例上设置的累积属性构建一个W3CEndpointReference 。
这种方法可以被用来创建一个W3CEndpointReference通过指定任何端点address与任何其它所需的性质沿属性。 这种方法也可以用来创建一个W3CEndpointReference对于由同一个Java EE应用程序发布的端点。 这种方法可以自动判断address由被识别的同一Java EE应用程序发布的端点serviceName和endpointName性能。 如果address为null和serviceName和endpointName不认同由同一个Java EE应用程序发布的一个端点,一个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 - 创建
W3CEndpointReference时发生错误。
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.