随笔-128  评论-55  文章-5  trackbacks-0
 

对于 WSDL 解析,有如下 3 种基本方法:

1.       基于 DOM 的方法:由于 WSDL 文件从本质上来讲是一个 XML 文件,现有的 DOM API(例如 Xerces)能够用来进行解析或者构建 WSDL 文件。这种方法是最通用的,但同时也是处理 XML 文件最费力的方法。尽管从技术上来讲是可行的,基于 DOM API 的实现对于代码敏感且容易出错。同时,这一解决方法迫使您不得不处理两个完全不同的模型:DOM WSDL 模型。

2.       基于特定 API 的方法 利用 IBM WSDL4J 来实现 WSDL 操作就是一个例子。这种方法倾向于 WSDL 模型,它允许您直接操作 WSDL 。这种方法的不足在于您不仅要处理 WSDL 本身,还要处理 WS-AddressingWS-Policy 和扩展脚本。它同时还使用那些尚未成为标准的事物,这就意味着现有的一些 API 将会改变。在当前,一些试验性的 API 支持 WS-Addressing 的当前版本,但对于 WS-Policy 和扩展脚本却根本不支持。这就意味着这种基于特定 API 的方法不得不掺杂一定数量的 DOM 处理。

3.       基于 Java 生成的方法:因为描述我们实现的所有脚本都是标准的 XML 脚本,因此可以生成对应于这些脚本的 Java 类(支持 XML 编组和分组)。在这种情况下, WSDL 文件直接转化为 Java 类,然后作为 Java 对象来管理。考虑到标准在不断进化这一事实,定制性的扩展将是很有必要。由于它的灵活性和对变化的适应性,这一方法最适合实现我们的解决方案。

对于WSDL模型目前有以下两种:

1.       JSR110规范,“Java APIs For WSDL”,是JavaWSDL1.1建模规范。

目前的实现是WSDL4J。最新版本为WSDL4J V1.6.22006-11-08)。

The Web Services Description Language for Java Toolkit (WSDL4J) allows the creation, representation, and manipulation of WSDL documents. Is the reference implementation for JSR110 'JWSDL'

网址为:http://sourceforge.net/projects/wsdl4j/

2.       Apache Woden 开源项目。对WSDL2.0规范的建模。

最新版本为 Woden V1.0M7b2007-08-03

The Woden project is an incubation subproject of the Apache Web Services Project to develop a Java class library for reading, manipulating, creating and writing WSDL documents, initially to support WSDL 2.0 but with the longer term aim of supporting past, present and future versions of WSDL.

There are two main deliverables: an API and an implementation. The Woden API will consist of a set of Java interfaces. The WSDL 2.0-specific portion of the Woden API will conform to the W3C WSDL 2.0 specification. The implementation will be a high performance implementation directly usable in other Apache projects such as Axis2.

       网址是:http://ws.apache.org/woden/index.html



Author: orangelizq
email: orangelizq@163.com

欢迎大家访问我的个人网站 萌萌的IT人
posted on 2008-04-08 20:40 桔子汁 阅读(2241) 评论(0)  编辑  收藏 所属分类: Web Service

只有注册用户登录后才能发表评论。


网站导航: