理解 UDDI 注册中心的 WSDL(3) - 51CTO.COM

来源:百度文库 编辑:神马文学网 时间:2024/04/27 18:34:13
理解 UDDI 注册中心的 WSDL(3)
http://tech.51cto.com  2006-12-19 14:10  Peter Brittenham等  developerWorks 中国  我要评论(0)
摘要:Web 服务描述语言(WSDL)有多种用法。特别是,根据应用程序的需要,WSDL 在 UDDI 注册中心有好几种使用方法。在这篇文章中,我们将介绍一下在 UDDI 注册中心使用 WSDL 的几种不同的方法。
标签:UDDI  WSDL
限时报名参加“甲骨文全球大会·2010·北京”及“JavaOne和甲骨文开发者大会2010”
发布服务实现
服务实现在 UDDI 注册中心是作为带有一个或多个 bindingTemplate 的 businessService 发布的。 businessService 由服务提供者发布。
UDDI businessService
将为服务实现文档中定义的每个 service 元素创建一个新的 businessService。 下面的表中包含 businessService 元素列表,这些 businessService 元素可根据 WSDL 服务实现文档的内容创建。
 
UDDI businessService 描述 必需
1 name businessService 的 name 元素根据服务实现文档中的 service 元素的 name 属性设置。 是
2 description description 元素根据 service 元素中的 documentation 元素的内容设置。 description 元素的英文值根据与 service 元素关联的 documentation 元素中的前 256 个字符设置。如果 documentation 元素不存在,那么 businessService 的 description 元素就没有被设置。 否
 
UDDI bindingTemplate
新的 bindingTemplate 元素是在 businessService 中为 service 元素中定义的每个 port 元素而定义的。
 
UDDI bindingTemplate 描述 必需
1 description 如果 port 元素包含一个 documentation 元素,那么就有一个 description 元素是根据 documentation 元素的前 256 个字符设置的。 否
2 accessPoint 对于一个 SOAP 或 HTTP 绑定,accessPoint 是根据与 port 元素关联的扩展元素的 location 属性设置的。 这个元素将包含 URL,且 URLType 属性是根据此 URL 中的协议设置的。对于不使用 URL 规范的协议绑定,应该使用 URLType 属性指出协议绑定的类型, 并且 accessPoint 元素应该包含一个可用于定位使用指定协议的 Web 服务的值。 是
3 tModelInstanceInfo bindingTemplate 将包含自己引用的每个 tModel 的一个 tModelInstanceInfo 元素。至少将有一个 tModelInstanceInfo 元素包含对表示服务接口文档的 tModel 的直接引用。 是
4 overviewURL overviewURL 元素可能包含对服务实现文档的一个直接引用。对这个文档的引用仅用于提供对人类可读的文档的访问。这个文档中的其它所有信息都应该能够通过 UDDI 数据实体访问。通过维持对原始 WSDL 文档的直接引用,您可以确保被发布的文档就是查找操作返回的那个。如果这个文档包含多个端口,那么这个元素应该包含对端口名的直接引用。 由于可能会有多个端口引用同一个绑定,只使用 tModel 中的直接引用是不够的。 端口名被指定为 overviewURL 上的片段标识符。片段标识符是 URL 的一个扩展,使用“#”字符作为一个分隔符。 否
 
服务实现到 businessService 的映射示例
清单 3包含 WSDL 服务实现文档的一个示例。突出显示的值是将 WSDL 信息映射到 UDDI businessService 和 bindingTemplate 时必需的值。值显示在图表关键字中。
清单 3:WSDL 服务实现示例
This service provides an implementation of a standard stock quote service. The Web service uses the live stock quote service provided by XMLtoday.com. The XMLtoday.com stock quote service uses an HTTP GET interface to request a quote, and returns an XML string as a response. For additional information on how this service obtains stock quotes, go to the XMLtoday.com web site: http://www.xmltoday.com/examples/soap/stock.psp. Stock Quote Service Single Symbol Stock Quote Service
关键字:Service― service 元素的 name 属性被用作 businessService 的名称。service 元素中的 documentation 元素被用于描述 businessService。
Import― 端口名被附加到 overviewURL,此 overviewURL 包含对服务实现文档的引用。服务的位置被用于设置 bindingTemplate 中的 accessPoint。