您的位置:首页>项目管理>质量管理>

将 iSeries Web 服务导入 WebSphere Integration developer

[ 来源:developerworks | 更新日期:2007-7-15 20:25:36 | 评论 0 条 | 我要投稿 ]

本文介绍了如何将 WebSphere? Development Studio Client for iSeries 生成的 iSeries? Web 服务导入 WebSphere Integration Developer 服务组件中。
引言
字串5

进入随需应变的时代以来,我们对业务整合的需求从未如此强烈过。现在,业务部门之间的合作更加频繁,将其各种应用程序进行紧密集成的需求应运而生。先前独立的业务部门被整合起来,以缩减管理经费,并使产量最大化。这种促使业务部门间进行应用程序集成的动力同样存在于企业之间,因为进行合作或并购需要共享数据和流程。 字串3

IBM? WebSphere Integration Developer 提供了一个优化的构建集成应用程序的完整的集成开发环境。通过使用 WebSphere Integration Developer,您可以构建和部署扩展并集成了您现有 IT 资产的集成应用程序。IBM WebSphere Development Studio Client for iSeries 帮助您构建适合 iSeries 的应用程序。通过随时运用最新的核心理论,WebSphere Integration Developer 还加速了对在 WebSphere Development Studio Client 的基础上的应用程序的集成。WebSphere Development Studio Client 可以调用 iSeries 的业务逻辑。

字串3

本文通过 Web 服务来检验 WebSphere Development Studio Client 和 WebSphere Integration Developer 的一个集成点。文中展示了如何将 WebSphere Development Studio Client for iSeries 生成的 iSeries Web 服务导入 WebSphere Integration Developer 服务组件中。然后,您可以通过 WebSphere Integration Developer Assembly Diagram 将该服务组件与其他服务组件集成在一起,形成一个业务集成应用程序。 字串4

在本文中我们向您展示如何: 字串4

在 WebSphere Development Studio Client - Advanced Edition 6.0 中创建 iSeries Web 服务。
在 WebSphere Integration Developer 6.0 中用 Assembly Diagram 创建一个 Web 服务导入组件。
测试上面创建的 Web 服务导入组件。
在创建了 WebSphere Integration Developer 服务组件后,您可以使用 Assembly Diagram 将其连接到其他服务组件,以创建一个无缝集成的应用程序。不过,这已经超出了本文的讨论范围。
字串4

先决条件 字串4

WebSphere Integration Developer 6.0
WebSphere Development Studio Client 6.0 或 WebSphere Development Studio Client 6.0 - Advanced Edition
Windows? 2000/XP Professional
为了达到本次练习的目的,我们在 Windows XP Professional Edition 中同时使用了 WebSphere Development Studio Client-Advanced Edition 6.0 和 WebSphere Integration Developer 6.0。此外,我们还使用 WebSphere Development Studio Client - Advanced Edition 6.0 来生成 iSeries Web 服务,因为它支持 JCA 到 iSeries 的连接。使用 WebSphere Integration Developer 6.0 来创建用于业务集成应用程序的 Import 服务组件。 字串6

在 WebSphere Development Studio Client 中创建 iSeries Web 服务

字串5

在这一部分中,我们将创建 iSeries Web 服务,在后面 WebSphere Integration Developer 将用到它。 字串3

第 1 步. 通过 Program Call 向导生成一个 Java Bean 和 PCML 文件

字串8

打开一个 Web Perspective。
新建一个 Dynamic Web 项目。
在 Project Explorer 中选择该项目。
在 Workbench 菜单栏中,单击 Create Program Call Bean 图标 。这将打开 Program Call 向导。如果您有一个已包含 iSeries 程序的定义的 PCML 文件,则可以将该文件导入到向导中来创建 Java? Bean。否则,使用向导来创建程序和参数定义:
在 Add Program 页面键入您的 Java Bean、程序对象及其所在的库的名称。您可以单击 Browse 来查找您想从 iSeries 服务器调用的程序。
单击 OK。这将确定您想调用的程序或过程。
在 Add Parameter 页面为每个参数输入名称、长度、数据类型和用法。单击 OK。
单击 Next 进入向导的下一页。
在 Package 字段中,为您希望创建文件的包命名。您可以指定一个新的包名。
取消选中 Java Application 复选框,并确认已选中 Services 复选框。
单击 Next,输入将保存在 run-time 配置文件中的配置信息。
在 Authentication 下输入 Host name、User ID 和 Password 的值。

字串1

在 Library list 下键入保存 iSeries 程序的库文件名,单击 Add。
单击 Finish。
Program Call 向导会生成三个类。其中一个类名为 Services.java,是可被 Web 服务向导用来创建 Web 服务的 Java Bean。另外两个分别名为 Input.java 和 Result.java。这两个类是 Java Bean 类的输入和输出参数所需的。 字串8

第 2 步. 通过 Web 服务向导从 Java Bean 和 PCML 文件创建 Web 服务: 字串7

您在 Program Call 向导中定义的每个程序都会生成两个方法。您可以任选一个来获取远程程序调用返回的数据。

字串6

第一个方法以 XML 格式返回输出数据。Web 服务客户机可以通过分析 XML 字符串获取数据。
第二个方法以 Result.java 类的形式返回输出数据。Web 服务客户机可以通过使用该类的 getter 方法来获取数据。
现在您可以通过 Web 服务向导来从 Program Call 向导创建的类中创建 Web 服务: 字串4

在 Project Explorer 中的 Java Resources 的 package 名称下,右键单击 Services.java。
依次选择 New > Other > Web Services > Web Service。(您可能需要选中 Show all wizards 复选框。)
单击 Next。
对于 Web 服务类型,应该已经自动选择了 Java Bean Web Service,如图 1 所示: 字串1

图 1. Web 服务类型 字串3

字串4

取消选择 Start Web service in Web project
单击 Next。
在 Object Selection 页面上,浏览并找到 Services。单击 Next。
调整 Service Deployment Configuration 设置。您可以将 Web 服务部署到 WebSphere Application Server 或 Websphere Process Server 中。这两种情况都将从 WebSphere Process Server 中调用 Web 服务(请参见图 2): 字串3

图 2. 服务部署配置 字串3

字串3

单击 OK,然后单击 Next。
单击 Deselect All, 然后选择方法,这些方法的名称应以 Program Call 向导中 Java Bean 名称字段的内容开头。单击 Next。
单击 Finish。
现在已经生成了 Web 服务,我们可以通过 WebSphere Integration Developer 来对其进行集成。 字串4

通过 WebSphere Integration Developer 集成 iSeries Web 服务

字串1

在这一部分中,我们将上一节中创建的 Web 服务集成到 WebSphere Integration Developer 组件中。

字串6

第 1 步. 创建服务组件 字串2

打开 WebSphere Integration Developer v6.0(请参见图 3): 字串7

图 3. WebSphere Integration Developer 字串6

字串3

在 Business Integration perspective 中,右键单击 New > Module,创建一个新模块(请参见图 4): 字串1

图 4. 创建一个新模块 字串6

字串5

为这个新模块 (iSeriesServiceModule) 输入名称,然后单击 Finish。缺省情况下,WebSphere Integration Developer 会自动创建图 5 中所示的模块构件和目录: 字串3

图 5. 生成的模块构件 字串4

字串4

有关 WebSphere Integration Developer 构件的详细信息,请参阅参考资料。 字串6

现在我们可以导入 WebSphere Development Studio Client 6.0 生成的 iSeries Web 服务 WSDL 文件了。从 iSeries Web 项目的 WebContentwsdl 文件夹复制 WSDL 文件,并粘贴到 Business Integration Perspective 的 iSeriesServiceModule 项目中。
将 WSDL 文件复制到 Business Integration perspective 中时,WebSphere Integration Developer 会另外创建一个目录(如果尚未创建)。特别是一个 Web Service Port 目录以及相应的 Ports、Interfaces 和 Data Types 构件(请参见图 6)。它通过分析 WSDL 文件来获取其中的 Ports、Port Types 和 Messages 信息。

字串4


图 6. 生成的目录和构件 字串3

字串9

现在我们可以创建将调用 iSeries Web 服务的服务组件了。通过双击 Module 文件夹中的 模块打开 Assembly Diagram。
将 WSDL 文件从 Web Service Ports 拖到 Assembly Diagram
在 Component 创建向导中选择 Import with Web Service Binding,如图 7 所示:

字串4

图 7. 创建组件 字串2

字串1

这将创建一个指向 iSeries Web 服务的服务组件,如图 8 所示: 字串2

图 8. Assembly Diagram 字串2

字串8

同时按下 Ctrl+S,保存 Assembly Diagram。
第 2 步. 测试组件 字串8

要测试新组件,请执行下列操作: 字串8

运行 WPS 6.0 测试服务器。
在服务器上部署您的 Web 服务和 Module 应用程序。如果已经在其他地方部署了 Web 服务,则您只需要在 WebSphere Process Server 上部署 Module 应用程序。否则,您需要将您的 Web 服务项目从 WebSphere Development Studio Client 导入到 WebSphere Integration Developer 中,然后与 Module 应用程序一起部署到 WebSphere Process Server 上。
确保所需的应用程序全部成功部署。
右键单击 Assembly Diagram 中的组件并选择 Test Component
选择 WebSphere Process Server 进行测试
输入值并调用您的服务(请参见图 9):

字串9

图 9. 测试组件 字串2

字串2

结果应与图 10 中相似:

字串4

图 10. 输出结果 字串2

字串6

有关测试 WebSphere Integration Developer 组件的详细信息,请参阅参考资料。 字串1

您已经成功地将 iSeries Web 服务作为服务组件部署到 IBM WebSphere Integration Developer 6.0 中。现在您可以将该服务组件及其他企业服务组件集成到 WebSphere Integration Developer 业务集成应用程序中。

字串3

总结

字串7

在本文中,我们注意到了跨业务部门和企业集成业务应用程序的重要性。面向服务是业务集成的一个关键理念。任何面向服务或面向服务的体系结构 (SOA) 的基础都是从业务流程开始的,因为服务只是一项业务任务。要成功地提高 IT 灵活性并解决实际当中的业务问题(例如,改善客户服务、与业务伙伴集成或创建统一的客户视图),您必须使业务与 IT 紧密结合。

字串6

为了实现这种结合,我们介绍了在 WebSphere Development Studio Client 中创建的 Web 服务如何作为 WebSphere Integration Developer 服务组件加入 WebSphere Integration Developer 中。因为 WebSphere Integration Developer 本身基于行业标准面向服务的体系结构的概念,所以它构成了业务服务的逻辑集成点。

字串1

参考资料

字串2

您可以参阅本文在 developerWorks 全球站点上的 英文原文。 字串1


WebSphere Integration Developer 字串5


WebSphere Studio Development Client for iSeries 字串1

作者简介

字串5

字串5

Cindy Lee 是加拿大 IBM Toronto Lab 的一位高级技术管理人员。她是 iSeries Application Development Tool 部门高级解决方案架构师,该部门开发各种各样的 iSeries 产品,包括 WebSphere Development Studio 和 WebSphere Development Studio Client for iSeries。Cindy 在工作中大量使用 iSeries COBOL 编译器、WebSphere 和 Web 服务。您可以通过 cinderel@ca.ibm.com 与 Cindy 联系。

字串5

字串5

Rishi Misra 是 IBM Toronto的一名软件开发人员。他目前在 iSeries Application Development Tools area 工作,致力于多种产品的研究,包括 WebSphere Development Studio 和 WebSphere Development Studio Client for iSeries。Rishi 于 2001 年加入 IBM,主要从事用于 iSeries 的 ILE 编译器的研究。Rishi 于 1998 年获得了滑铁卢大学(University of Waterloo)应用科学学士学位。您可以通过 rishi@ca.ibm.com 与 Rishi 联系。

字串1


Tags:
责任编辑:
您的评论
用户名: 新注册) 密码: 匿名评论 [所有评论]

·用户发表意见仅代表其个人意见,并且承担一切因发表内容引起的纠纷和责任
·本站管理人员有权在不通知用户的情况下删除不符合规定的评论信息或留做证据
·请客观的评价您所看到的资讯,提倡就事论事,杜绝漫骂和人身攻击等不文明行为