WebSphere Product Center:门户网站启用
版本 5.2
注意!在使用本资料及其支持的产品之前,请阅读本文档末尾处的『声明』中的信息。
2005 年 3 月 21 日
本文档的此版本适用于 WebSphere Product Center(5724-I68)V5.2 及所有后续发行版和修订版,直到在新版本中另有声明为止。
Copyright International Business
Machines Corporations 2005. All rights reserved.
US Government Users Restricted Rights-Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
第 2 章 门户网站集成框架的体系结构
Product Center 的集成框架
Websphere Portal Server 的 Web Service 功能
数据
Product Center 的请求数据和响应数据
项规范
组件
Product Center 介体
Web Service 接口
数据转换器
数据类型
数据 bean
用户界面组件
数据交换服务
服务
国际化/本地化支持
安全性支持
资源
使用 LDAP 配置 Portal Server 安全性
为 LDAP 配置数据库
为 LDAP 配置数据库
添加后缀
创建门户网站用户
配置门户网站
创建门户网站管理用户
为供应商门户网站定制登录服务
Product Center 配置
结论
资源
第 4 章 创建 Product Center Portlet
样本 portlet - WorkWithItem
XML 消息
用于表示项的数据对象
XML 生成器和 XML 解析器
对 Product Center 介体添加方法
创建 portlet
指向 Product Center Server 的 Web Service
部署供应商门户网站
为供应商门户网站定制 UI
创建导航菜单
安装主题和皮肤
将 Portlet 安排到选项卡中
提供对选项卡的访问许可权
更新配置文件
配置文件
结论
第 6 章 用户界面框架
Portlet 结构
Portlet 库存
第 7 章 消息格式概述
涉及的脚本和 Web Service 的概述
不同的消息格式
WebSphere Product Center 的门户网站启用功能为客户构建贸易伙伴门户网站提供了基础。门户网站创新功能使数以千计的用户能够访问宝贵的项数据,从而大大提升 WebSphere Product Center 实现的价值。
门户网站功能支持的业务流程示例包括:创建或修改项、修改已同步的项信息、成批上载项、特定于用户的选择以及输入计划、期限和条件数据的能力。
Websphere Portal Server 可以方便地与 WebSphere Product Center 集成。Portal Server 集成功能提供了从 Portal Server 中执行下列指定操作的能力:
在 WebSphere Product Center 中添加项
在 WebSphere Product Center 中修改项
在 WebSphere Product Center 中删除项
根据 GTIN(全球交易标识号)、SKU(库存标识)和 GLN(全球位置码)来搜索项
支持选择
CSV(逗号分隔的值)上载和下载
成批更新
本文假定在 WebSphere Product Center 环境中使用了下列组件:
目前,WebSphere Product Center 未提供任何产品信息管理 Portlet。不过,WebSphere Product Center 提供了一些 API 和元数据,这些 API 和元数据是支持进行 Portlet 和供应商门户网站用户界面开发工作所必需的。
本章阐述如何为 IBM WebSphere Product Center(以下称为 Product Center)创建 portlet。本章描述了用于为 Product Center 提供用户界面的体系结构。
集成框架提供了对在 Product Center 中使用 portlet 的支持,从而允许用户查看和使用 Product Center 信息。用户界面框架与 Product Center 之间的集成基于 Product Center 中的 Web Service 支持。
体系结构由一些 portlet 组成,这些 portlet 通过 Product Center 提供的 Web Service 接口来与 Product Center 通信(请参阅图 1)。Product Center 提供了一个脚本编制层,后者可用作 API 层。这些脚本可进一步作为 Web Service 公布。为需要在 Product Center 中公布的每项业务功能创建一个 Web Service。创建相应的 portlet 以便与此 Web Service 进行交互。该 Web Service 将在 Product Center 中执行一个或多个脚本,并且将与其它 Web Service 配合工作以提供所需的业务功能。由于 Web Service 在脚本之间以及在其它 Web Service 之间执行必需的协调工作,所以它能够完成下列任务:
图 1
对于门户网站集成来说,数据传输方式是 XML 文档,并且,根据请求消息的接收方式的不同,将立即发送响应或延迟发送响应。下面的图 2 说明了完整的体系结构。
图 2
Product Center 与 Websphere Portal Server 之间的通信始终是通过基于文档/文字的 XML 文档变换进行的。对 ASYNC / SYNC 事务进行的维护依赖于 Product Center Web Service 框架,并且不应该依赖于实现脚本级别。因此,在任何时间都可以使任何操作成为 ASYNC / SYNC 操作,而不必更改脚本。
数据交换格式是 XML,数据模型基于单个包络或容器,该包络或容器定义了处理事务所需的信息。包络定义了下列内容:
表 1 提供了一个请求 XML 结构样本:
表 1:请求 XML
<wpc:envelope xmlns:wpc="http://ibm.com/wpc/" communicationVersion="5.2">
<wpc:WPCResponseType>synchronous</wpc:WPCResponseType>
<wpc:wpcHeader>
<wpc:companyName>TSS</wpc:companyName>
<wpc:userID>Scott</wpc:userID>
<wpc:password>null</wpc:password>
<wpc:messageIdentifier> 905EF150-8F05-11D9-B150-B7A43B4A833E </wpc:messageIdentifier>
<wpc:timestamp>2005-03-07</wpc:timestamp>
<wpc:supplierId>1234567890123</wpc:supplierId>
</wpc:wpcHeader>
<wpc:wpcBody>
<wpc:wpcCommand type="ITEMDETAIL" mode="SYNC">
<wpc:wpcParentCategory />
<wpc:wpcCatalogName>CTG_PORTAL_MASTER </wpc:wpcCatalogName>
<wpc:wpcTradeItem ID="C139" />
</wpc:wpcCommand>
</wpc:wpcBody>
</wpc:envelope>
表 2 提供了相应的响应 XML 样本。
表 2:响应 XML
<wpc:envelope communicationVersion="5.2" xmlns:wpc="http://ibm.com/wpc/">
<wpc:wpcHeader>
<wpc:companyName>TSS</wpc:companyName>
<wpc:userID>wpsadmin</wpc:userID>
<wpc:password>null</wpc:password>
<wpc:messageIdentifier>1110199602</wpc:messageIdentifier>
<wpc:timestamp>2005-03-07</wpc:timestamp>
</wpc:wpcHeader>
<wpc:wpcBody>
<wpc:wpcResponse>
<wpc:wpcEntityIdentifier>
<wpc:wpcMessageIdentifier>8CD1DD80-8F06-11D9-9D80-A9B52946044C</wpc:wpcMessageIdentifier>
</wpc:wpcEntityIdentifier>
<wpc:wpcNotification type="SUCCESS">
<wpc:notificationInfo>
<wpc:notificationCode>000</wpc:notificationCode>
<wpc:notificationMessage>SUCCESS</wpc:notificationMessage>
</wpc:notificationInfo>
</wpc:wpcNotification>
<wpc:wpcTradeItem ID="C144">
...
...
</wpc:wpcTradeItem>
</wpc:wpcResponse>
</wpc:wpcBody>
</wpc:envelope>
项规范是项及其属性集合的特定于 Product Center 的定义。您可以通过 XML 文档获取此定义。项规范用来引用各种用于定义项及其属性的数据类型。项规范与视图定义一起用来显示 portlet 屏幕 - 以自动显示方式显示,或者,如果开发者需要进行手工编码,则通过 JSP 显示。
框架由一组组件组成,这些组件用来与 Product Center 执行交互以及执行数据变换。
介体用来与 portlet 以及 Product Center Web Service 进行交互。它用作这两个层的单一接触点,并且还执行必需的数据变换以使数据可供这两个层使用。介体是作为供 Portlet 使用的接口公布的。
Web Service 交互是使用 AXIS Web Service 调用框架进行的。Web Service 层与 AXIS 客户机进行交互以对 Product Center 启动相应的 Web Service 调用。Web Service 调用的类型是文档/文字,使用 SOAP 作为通信协议,并且此调用当前是通过 HTTP 传输方法执行的。使用当前 Web Service 层来交换 XML 数据以及上载和下载附件。AXIS 中的“带附件 SOAP”(SwA)实现即用于此用途。请参阅本章中的『资源』一节以了解有关 AXIS 框架的更多信息。
配置文件中存储了一系列 Web Service,从用户界面执行的操作需要调用这些 Web service。操作到 Web Service 的这种映射是按以下方式指定的:
表 3:操作到 Web Service 的映射
<soap-url action="<action name>">http://<server name>:<server port>/services/<service name></soap-url>
<soap-url action="ADD">http://ibm.com:9557/webservices/addAction</soap-url>
介体层使用一组解析器和生成器来对 Product Center 提供的 XML 内容进行解析并转换 XML 内容以供 Product Center 使用。这些转换器在 XML 格式的数据与预定义的 Java 对象之间进行来回转换。面向 Java 对象的转换要求支持一组已定义的数据类型和数据对象。下面的章节将对这些数据类型和数据对象进行讨论。
Product Center 为它的项定义定义了一组属性。这些属性具有各种各样的类型,这些类型可以是字符串和数字,也可以是组属性。这些属性类型以及它们在用户界面框架端的行为是从一组属性类和属性类型类中获取的。
图 3 列示了完整的受支持属性列表。这些属性提供表示验证功能、格式化功能以及显示功能的基础。
数据 bean 为 portlet 中显示的内容提供支持,并且还用来通过存储 portlet 的当前状态或方式控制用户界面流。
用户界面组件主要与显示用户界面和处理用户交互相关,并且还用于对介体层执行特定的调用以便从 Product Center 获取数据或者将数据存储到 Product Center。主要的用户界面组件是 portlet 以及用来为 portlet 显示用户界面的标记库。
图 3
部署在门户网站服务器中的 portlet 没有一种很好的方法来交换信息,当 portlet 位于不同页面上时尤其如此。只有位于同一个页面上的 portlet 才能在 portlet 之间进行有效的通信。数据交换服务为所有 portlet 提供了单一接触点,它能够存储信息,portlet 使用此服务来交换数据。目前,此服务是一个单例类,并且它是作为简单 Java 方法调用被调用的。将扩展此服务以便为更大范围或更多类型的对象交换提供服务,并且此服务也作为独立应用程序部署以改进性能调整方面的功能。
用户界面框架利用门户网站服务器提供的基础结构来提供国际化支持并实现安全性。
门户网站服务器提供了一组定制标记和资源束来将门户网站框架显示的内容本地化 - 主题和皮肤。portlet 的内容是使用一组资源束进行本地化的,这些资源束为标签、按钮以及显示的消息提供内容。从 Product Center 获取的内容根据应用程序级别提供的语言环境支持来进行本地化。
基于门户网站的用户界面框架和 Product Center 使用 LDAP 来作为存储用户注册表的方法。Product Center 和用户界面框架使用两组不同的用户模式来存储用户信息。这主要是因为在门户网站级别注册的用户使用门户网站来执行供应商或销售商门户网站交互,而对 Product Center 注册的用户主要是系统的超级用户或管理用户。用户注册表领域的下一举措是对框架和 Product Center 使用的模式进行集成。这也将导致使用公共的用户注册表以及用户及其角色定义。
用户的认证
对于销售商门户网站方案,供应商和一般用户使用门户网站来注册他们自己并通过门户网站登录。用户管理以及随后进行的用户认证是在门户网站的 LDAP 级别执行的。门户网站与底层 Product Center 层共享的关键信息是供应商标识信息。此信息用来对用户创建或使用的数据进行过滤。
用户的授权
对已登录用户授予数据访问权主要是 Product Center 的功能。在现阶段,系统对授权的处理基本上是基于供应商标识的数据过滤。门户网站提供了一定程度的门户网站访问授权,即根据用户是管理用户还是一般用户来允许用户查看和执行操作。
本文描述了 Product Center 的门户网站集成框架的体系结构。
下列各节详细描述了为了能够在组织中部署供应商门户网站而必须进行的环境设置。
本章假定 WebSphere Product Center 环境中安装了下列软件:
您选择使用的操作系统将要求安装特定的软件组合。供应商门户网站的基本工作平台是 Portal Server V5.0.2.2。
WebSphere Product Center 的门户网站集成安装包含两个压缩文件。其中一个文件部署在 Portal Server 上,另一个文件部署在用于门户网站集成的 Product Center 服务器上。
在供应商门户网站的设置过程中,执行的第一个步骤包括为 LDAP 配置 Portal Server 安全性。此步骤假定已安装了下列软件:IBM DB2、Directory Server 和 Directory Server Administration Tool。
此步骤为 LDAP 配置 DB2 实例。
1. 通过浏览开始 -> 程序 -> IBM Tivoli Directory Server -> 目录配置打开 Directory Server 配置工具。
2. 在配置工具的左窗格中选择管理员 DN/密码。
3. 输入下列字段值:
4. 单击确定。
5. 在配置工具的左窗格中选择配置数据库。
6. 选择创建新数据库选项,然后单击下一步。
7. 输入 DB2 管理用户的用户标识和密码(通常是 db2admin 和 password)。单击下一步。
8. 在下一个屏幕中,输入 DB2 实例名作为数据库名称。单击完成。
此步骤为 LDAP 层次结构添加后缀。
1. 通过浏览开始 -> 程序 -> IBM Tivoli Directory Server -> 目录配置打开 Directory Server 配置工具。
2. 在配置工具的左窗格中选择管理后缀。
3. 在“后缀 DN”字段中输入字符串“dc=wps,dc=com”。
4. 单击添加,然后单击确定。
此步骤定义一系列有权访问门户网站的用户。
1. 通过浏览开始 -> 程序 -> IBM Tivoli Directory Server -> 目录配置打开 Directory Server 配置工具。
2. 在配置工具的左窗格中选择导入 LDIF 数据。这将打开一个屏幕,该屏幕提供了用于浏览 LDIF 文件和导入用户数据的选项。
3. 为供应商门户网站选择必需的 LDIF 文件,然后执行“导入”。导入状态将反映在任务消息区域中。
此步骤配置门户网站的安全性。
1. 确保已安装 Directory Server 并已执行 WebSphere Portal 所要求的任何设置工作。
2. 找到 <PortalServer_root>/config/wpconfig.properties 文件并且在更改任何值之前先创建一个备份副本。
3. 使用文本编辑器打开 <wp_root>/config/wpconfig.properties 文件。
4. 将所有以后缀 DN“dc=yourco,dc=com”结尾的条目替换为“dc=wps,dc=com”。
5. 根据您的环境,在“LDAP 属性配置”部分中编辑下列属性:
WasUserid=uid=wpsbind,cn=users,dc=wps,dc=com
WasPassword=wpsbind
PortalAdminId=uid=wpsadmin,cn=users,dc=wps,dc=com
PortalAdminIdShort=wpsadmin
PortalAdminPwd=wpsadmin
LDAPHostName=localhost(LDAP 主机的 IP 地址)
LDAPPort=389
LDAPAdminUId=cn=root
LDAPAdminPwd=password
LDAPServerType=IBM_DIRECTORY_SERVER
LDAPBindID=uid=wpsbind,cn=users,dc=wps,dc=com
LDAPBindPassword=wpsbind
LDAPSuffix=dc=wps,dc=com
6. 保存文件。
7. 打开命令提示符并转到 <AppServer_root>/bin 目录。
8. 输入下列命令:
startServer server1
stopServer WebSphere_Portal
9. 转到 <PortalServer_root>/config 目录。
10. 输入以下命令以运行适当的配置任务:
WPSconfig.bat validate-ldap
注意:如果配置任务失败,请对 wpconfig.properties 文件中的值进行验证。
11. 输入以下命令以运行适当的配置任务,从而启用 LDAP 安全性:
WPSconfig.bat enable-security-ldap
12. 转到 <AppServer_root>/bin 目录并输入下列命令:
(a)stopServer server1
(b)startServer server1
(c)startServer WebSphere_Portal如果在 WebSphere Application Server 中已启用安全性,您在输入命令时就必须指定用户标识和密码以进行安全认证:
(d)stopServer server1 -user was_admin_userid -password was_admin_password
(e)startServer server1
(f)startServer WebSphere_Portal注意:信息中心提供的一些步骤依赖于安装类型和操作环境。根据需求的不同,可以不执行这些步骤。
此步骤创建具有管理特权的门户网站用户。
1. 登录到 Directory Server Web 管理工具。
2. 选择模式管理 > 添加属性并添加下列属性:
WPCRole{语法 - 目录字符串语法,属性长度 - 50}
userStatus{语法 - 布尔值}
userGLN{语法 - 目录字符串语法,属性长度 - 50}
company{语法 - 目录字符串语法,属性长度 - 50}
3. 选择模式管理 > 添加对象类并添加以下内容:
对象类:wpcUserClass
必需属性 - abstract、company、UserStatus 和 WPCRole
可选属性 - userGLN
4. 保存所有这些更改。
5. 从配置工具导入文件 portalAdmin.ldif。提供了一个“管理 LDIF”样本文件以供您参考。
6. 使用 admin/admin/ibm 登录到门户网站
门户网站为 Product Center 提供了一个界面,该界面要求用户在登录到门户网站时输入用户标识、密码和公司信息。这要求对 Portal Server 提供的标准登录页面进行修改。
1. 在定制登录页面之前,需要为供应商门户网站配置具有管理特权的用户。
(a)使用门户网站管理员的用户标识和密码进行登录。
(b)单击顶栏上的“管理”链接,在左窗格中选择访问 > 用户和组。
(c)在显示的“组”中选择 wpsadmins。
(d)添加通过 portalAdmin.ldif 创建的用户“admin”并保存更改。这样,“admin”用户就拥有了供应商门户网站的管理特权。
2. 当门户网站用户登录到门户网站或者从门户网站注销时,WP 将执行相应的登录/注销命令。这些命令的类名是在属性文件 PortalServer_root>/shared/app/config/services/ConfigService.properties 中指定的,其缺省设置为:command.login = LoginUserAuth,command.logout = LogoutUserAuth
这些命令的包搜索路径是在属性文件 <PortalServer_root>/shared/app/config/services/LoaderService.properties 中以逗号分隔的列表形式指定的,其缺省设置如下所示:
command.path = com.ibm.wps.engine.commands
3. 将与 LDAP 相关的实用程序所需的 customlogin.jar 放到 <PortalServer_Root>/shared/app 文件夹中。
4. 将与 LDAP 相关的实用程序所需的 ibmjndi.jar 放到 <PortalServer_root>/shared/app 文件夹中。
5. 然后,确保可以在门户网站类路径中找到新的类,并在 LoaderService.properties 中的 command.path 中添加命令的包作为第一个条目。
例如:command.path=com.ibm.ccd.ui.services.user, com.ibm.wps.engine.commands
6. 编辑 <AppServer_root>/installedApps/<hostname>/wps.ear/wps.war/screens/html 文件夹中的“Login.jsp”并添加必需字段。例如,以下代码段在登录屏幕中添加“Company”字段,由于 Cancel 按钮代码段不是必需的,所以已将其注释掉。
<tr>
<td> </td>
<td align="<%= bidiAlignLeft %>" class="wpsEditText">
<label for="company">
<wps:text key="company" bundle="nls.field"/>
</label>
</td>
</tr>
<tr>
<td> </td>
<td> <input dir="ltr" class="wpsFieldText" size="16" value="" id="company" name="company" type="text"></td>
</tr>
7. 在 <PortalServer_root>/shared/app/nls/field.properties 属性文件中添加与 Login.jsp 相关的 nls 条目。
例如:company = Company
8. 在 <PortalServer_root>/shared/app/nls/problem.properties 属性文件中添加与 Login.jsp 相关的错误消息
9. 为供应商门户网站添加下列条目:
(a)login.invalid.userStatus = This User is InActive, Please contact your System Administrator.
(b)login.invalid.company = This User doesn't belong to this company, Please verify.
(c)ldap.not.configured = LDAP authentication service is failing. Please contact your System Administrator
使用下列步骤来正确地配置 Product Center 以便与 Portal Server 集成。
1. 在 common.properties 中为 soap_company、soap_user 和 trigo_web_url 设置值。
a) soap_company 是正在使用的 Product Center 公司的名称。
b) soap_user 始终是 Admin
c) trigo_web_url 将是 http://<ipaddress>:<port>
2. 挂装 public_html 目录。
3. 将 common.properties 中的 mountmgr 守护程序频率增大为 1000。
4. 更改 Portal_Config 查找表中的 FTP 详细信息。提供了样本值。
5. (Portal_Config 中的)ftpDir 应该位于 FTP 服务器上的根目录下面。
6. 使 /public_html/WEB-INF/server-config.wsdd 文件可写。
7. 首先导入 PORTAL_LKP.ZIP。
8. 接着导入 PORTAL_NON_LKP.ZIP。
9. 完成这些步骤后,务必重新启动服务器。
10. 使用 Web Logic 时,确保在更改以下代码块后保存 Web Service:
<xs:element name="wpcSearchElementOperator">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="="/>
<xs:enumeration value=">="/>
<xs:enumeration value="<="/>
<xs:enumeration value=">"/>
<xs:enumeration value="<"/>
<xs:enumeration value="!="/>
<xs:enumeration value="BEGINSWITH"/>
<xs:enumeration value="CONTAINS"/>
<xs:enumeration value="ENDSWITH"/>
<xs:enumeration value="ISEMPTY"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
更改为
<xs:element name="wpcSearchElementOperator">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="="/>
<xs:enumeration value=">="/>
<xs:enumeration value="<="/>
<xs:enumeration value=">"/>
<xs:enumeration value="<"/>
<xs:enumeration value="!="/>
<xs:enumeration value="BEGINSWITH"/>
<xs:enumeration value="CONTAINS"/>
<xs:enumeration value="ENDSWITH"/>
<xs:enumeration value="ISEMPTY"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
本章结束时,您应该已经完成了下列任务:
本章描述为 Product Center 创建 portlet 的步骤;我们将使用名为 WorkWithItem portlet 的现有 Product Center portlet 作为示例。
为了完成本章的内容,我们假定读者具备在 IBM WebSphere Portal Server 中开发和测试 portlet 的应用知识以及使用 IBM WebSphere Studio Application Developer 功能部件的实际经验。本章未阐述有关如何创建 Product Center 脚本的详细信息(在 Product Center 端,这些脚本用来为 portlet 的请求提供服务)。有关编写这些脚本以及将它们作为 Web Service 进行托管的详细信息超出了本章的范围。
框架基础结构以及使用此基础结构的 portlet 在下列各节中描述。此基础结构使用 XML 格式来交换数据,此 XML 由一个数据对象表示。还需要一些类来在 XML 与 Java 之间进行来回转换。需要将一组方法指定给 Product Center 介体以供 portlet 使用。
Product Center 中的项位于“Product Center 目录”下面。这些项是使用项规范描述的。此规范是一个属性集合。项按照类别和子类别进一步分组。这颗树(它表示类别)也被称为层次结构。
WorkWithItem portlet 帮助用户使用项,它是执行下列任务所必需的:
(a)查看项
(b)创建项
(c)修改项
(d)克隆项
(e)删除项
WorkwithItem portlet 的基本功能是查看、创建、修改、克隆和删除目录项。对于这些操作,此 portlet 需要通过 Web Service 以 XML 格式与 Product Center 交换数据。即,对于 portlet 中执行的每项操作,都要向 Product Center 发送 XML 格式的请求,在 Product Center 中进行处理后,它将发回 XML 格式的响应。
例如,要检索项详细信息,请求 XML 如下所示:
表 1:Product Center 的请求 XML
<wpc:wpcCommand type="ITEMDETAIL" mode="SYNC" >
<wpc:wpcParentCategory>1/5</wpc:wpcParentCategory>
<wpc:wpcCatalogName>CTG_PORTAL_MASTER</wpc:wpcCatalogName>
<wpc:wpcTradeItem ID="1732"></wpc:wpcTradeItem>
</wpc:wpcCommand>
此操作命令的目的是获取项的详细信息,调用方式是 SYNC/ASYNC。这些方式确定对 Product Center 调用的 Web Service API 是以同步方式工作还是以异步方式工作。对于这个特定的请求,要获取项的详细信息,ItemID、CatalogName 和 ParentCategory 是必需字段。
项详细信息的响应 XML 就是该项的属性集合,如下所示:
表 2:Product Center 的响应 XML
<wpc:attribute-list>
<wpc:attribute name="Master Item Spec/GTIN" type="STRING">
<wpc:values>
<wpc:value occurrence="0">1087383</wpc:value>
</wpc:values>
</wpc:attribute>
<wpc:attribute name="Master Item Spec/Effective Start Date" type="DATE">
<wpc:values>
<wpc:value occurrence="0">2005-01-06 00:00:00</wpc:value>
</wpc:values>
</wpc:attribute>
<wpc:attribute name="Master Item Spec/Product Content/Web Image" type="IMAGE">
<wpc:values>
<wpc:value occurrence="0">1109678022009_id-w3-sitemark-simple.gif</wpc:value>
</wpc:values>
</wpc:attribute>
...
</wpc:attribute-list>
根据请求 XML 和响应 XML 的结构,定义了一个数据对象来表示 Product Center 介体返回的数据。数据对象与 XML 字符串之间的来回转换是在 Product Center 介体层执行的。
例如,在“WorkWithItem”portlet 中,Product Center 项包含在“CatalogItem”类中,这个类具有一组属性。
XML 生成器和解析器用来在 Product Center 项的 Java 表示法与 XML 表示法之间执行来回转换。CatalogItemGenerator 构造 Product Center 请求 XML。生成的 XML 随命令的不同而有所变化;在本例中,命令的作用是获取项详细信息。用户提供的输入值将填充到这个 XML 中,这些值是从 portlet 请求对象中获取的。
下面提供的代码段仅仅是为项详细信息检索操作生成的 XML 示例。
public class CatalogItemGenerator {
public static String prepareItemDetailsRequestXML(
String parentCtgyID,
String catalogID,
String itemID) {
StringBuffer requestXML = new StringBuffer();
requestXML
.append(XMLHelper.WPC_NS_REF_BEG)
.append(ISoapMessageKeys.PARENT_CATEGORY)
.append(">")
.append(parentCtgyID)
.append(XMLHelper.WPC_NS_REF_END)
.append(ISoapMessageKeys.PARENT_CATEGORY)
.append(">")
.append(XMLHelper.WPC_NS_REF_BEG)
.append(ISoapMessageKeys.CATALOG_NAME)
.append("> ")
.append(catalogID)
.append(XMLHelper.WPC_NS_REF_END)
.append(ISoapMessageKeys.CATALOG_NAME)
.append(">")
.append(XMLHelper.WPC_NS_REF_BEG)
.append(ISoapMessageKeys.TRADE_ITEM)
.append(" ")
.append(ISoapMessageKeys.ID)
.append("=\"")
.append(itemID)
.append("\">")
.append(XMLHelper.WPC_NS_REF_END)
.append(ISoapMessageKeys.TRADE_ITEM)
.append(">");
return requestXML.toString();
}
}
}
CatalogItemParser 将 Product Center 响应 XML 的内容解析成目录项数据对象。
public class CatalogItemParser {
public static ICatalogItem prepareItem(
Element specElement,
Element tradeItemElement) {
// prepare the spec..
ICatalogItem item = getCatalogSpecItem(specElement);
// fill the item with attrib values
prepareItem(item, tradeItemElement);
return item;
}
}
}
在与 Product Center 进行任何类型的数据交换操作时,portlet 只应该与介体层进行交互。因而,介体必须具有所有这样的方法:即 portlet 类执行与 Product Center Web Service 调用相关的操作所需的方法。portlet 代表功能需求以及与用户交互相关的操作。在我们的 WorkwithItemPortlet 示例中,portlet 需要执行下列操作:
(a)查看项
(b)创建项
(c)修改项
(d)克隆项
(e)删除项
相应地,应该对介体层添加方法,并且希望这些方法执行下列操作:
(1)装入适当的 SOAP URL 以进行 Web Service 调用。
(2)创建请求 XML 以进行该方法调用。
(3)调用 SOAP URL 以启动 SYNC/ASYNC 调用。
(4)接收响应 XML 并对其进行解释。
(5)如果成功的话,对适当数据对象中的响应 XML 进行转换。
(5)如果不成功的话,以通知 Bean 形式将失败信息传递给 portlet。它应该抛出 WPCMediator 异常。
例如,介体中用于获取目录项的方法将与以下内容类似:
public ICatalogItem getCatalogItem(
String parentCgyID,
String catalogID,
String itemID,
WPSContext context)
throws WPCMediatorException {
try {
// getting the Item specs.
item = getCatalogItem(parentCgyID, catalogID, context);
//construct the item request XML to fetch data
String itemReqXML =
CatalogItemGenerator.prepareItemDetailsRequestXML(
parentCgyID,
catalogID,
itemID);
// call the soapHelper
Element itemElement = wsHelper.getCatalogItemXML(itemReqXML, user);
// prepare the item by parsing the results
CatalogItemParser.prepareItem(item, itemElement);
return item;
} catch (WPCMediatorException wpce) {
if (DEBUG) wpce.printStackTrace();
throw wpce;
}
}
接着,介体将调用委托给 WSHelper 类,于是后者创建请求 XML 并调用 SOAP URL。
public Element getCatalogItemXML(String itemReqXML, WPCUser user)
throws WPCMediatorException {
String requestXML = XMLHelper.prepareWPCRequest(
itemReqXML,
"ITEMDETAIL",
"SYNC",
user);
SoapResponse soapResponse = invokeSOAP(getSoapURL("ITEMDETAIL"),requestXML);
String responseXML = soapResponse.getDataXML();
}
如上所示,方法 getCatalogItem() 接收响应 XML 并继续将其传递至 CatalogItemParser,后者将响应 XML 转换为 CatalogItem 对象。
XMLHelper 为所有此类调用生成完整的 XML。
总而言之,任何介体操作的一般步骤如下所示:
Portlet > WPCMediator > WSHelper > SoapInvoker >Axis API
请参阅以下位置以了解有关在 Websphere Portal Server 中开发和部署 portlet 的详细信息:
<PortalServer_root>\doc\en\InfoCenter\index.html
Product Center portlet 将执行适当的 Product Center 介体调用,并且还确定需要作为该调用的结果向最终用户显示的消息。这些消息需被添加到消息集合中,请使用为这个添加操作提供的 API 来执行。
为当前 portlet 显示各种屏幕的 JSP 需要包含一个定制标记,该标记帮助显示这些用户消息的内容。
<wpctags:uimessages/>
修改配置文件(如 soapactionurls.xml)以指向适当的 SOAP URL。下面提供了一个样本配置文件:
<soap-url action="<action name>">http://<server name>:<server port>/services/<service name></soap-url>
<soap-url action="ADD">http://9.184.114.58:9999/services/wpc_portal_integrated_dev
</soap-url>
本章提供将供应商门户网站安装到 Product Center 并对其进行配置的详细步骤。
在环境中需要安装下列软件:
本步骤描述如何部署供应商门户网站。
1. 打开命令提示符并转至 <AppServer-Root>\bin,然后使用以下命令停止服务器:
stopServer WebSphere_Portal -username wpsbind -password wpsbind
2. 使用 URL http://localhost:9080/IDSWebApp/IDSjsp/Login.jsp 打开 Directory Server Web 管理工具,然后使用下列凭证进行登录:
LDAP 主机名:localhost
用户名:cn=root
密码:password
3. 停止 Web 管理工具。
4. 在命令提示符中,转到“DirectoryServer_Root\appsrv\bin”并使用以下命令停止 LDAP 服务器:
stopServer server1 -username wpsbind -password wpsbind
5. 下载应用程序 ZIP 文件并将内容解压缩。该文件应该包含 JAR 文件“customlogin.jar[I2]”。Product Center 安装 CD 也提供了这些文件。
6. 将 customlogin.jar 和 ibmjndi.jar 添加到 <PortalServer_Root>\shared\app 文件夹中。
7. 在命令提示符中,转到“DirectoryServer_Root\appsrv\bin”并使用以下命令启动 LDAP 服务器:
startServer server1 -username wpsbind -password wpsbind
8. 使用 URL http://localhost:9080/IDSWebApp/IDSjsp/Login.jsp 打开 Directory Server Web 管理工具,然后使用下列凭证登录:
LDAP 主机名:localhost
用户名:cn=root
密码:password
9. 启动 Web 管理工具。
10. 打开命令提示符并转到“AppServer_Root\bin”,然后使用以下命令启动门户网站服务器:
startServer WebSphere_Portal -username wpsbind -password wpsbind
11. 使用 admin/admin/ibm 登录。
12. 转到“管理”-> Portlet >“管理应用程序”。
13. 如果有先前的应用程序实例,则将其卸载。
14. 安装新的应用程序实例,并将 portlet 添加到要求的页面。
15. 根据需要,指定用户对 portlet 拥有的许可权。
在此步骤中,您为供应商门户网站定制 UI。此步骤为门户网站提供缺省布局和外观。
在门户网站定制过程中,在门户网站中创建下列标签,如图 1 所示:
图 1
为应用程序安装主题和皮肤。
1. 将文件“themes.zip”解压缩到 <AppServer_Root>\installedApps\<AppServer_HOST_NAME>\wps.ear\wps.war\themes\html 文件夹中。
2. 将文件“skins.zip”解压缩到 <AppServer_Root>\installedApps\<AppServer_HOST_NAME>\wps.ear\wps.war\skins\html 文件夹中。
3. 以管理员身份登录到门户网站服务器。
4. 单击右上角的管理员链接。
5. 转至门户网站用户界面 -> 主题和皮肤。
6. 单击添加新主题链接。
7. 输入“WPC_Default_theme”来作为新主题的名称和目录。单击确定。
8. 单击添加新皮肤链接。
9. 输入“WPC_Default_skin”来作为新皮肤的名称和目录。单击确定。
在各个选项卡下面对 portlet 进行组织,如下所示:
“主页”选项卡 |
|
“搜索”选项卡 |
|
“创建/编辑项”选项卡 |
|
“成批编辑”选项卡 |
|
“上载”选项卡 |
|
“注册”选项卡 |
|
执行下列步骤来为选项卡添加 portlet。
1. 以管理员身份登录到门户网站服务器。
2. 单击右上角的管理员链接。
3. 转至门户网站用户界面 > 管理页面。
4. 在右侧的屏幕上针对要求的页面选择编辑页面布局按钮。
5. 通过搜索页面,将所需的 portlet 添加到该页面中。
6. 对于上面提到的每个选项卡,重复步骤(4)和(5)。
1. 以管理员身份登录到门户网站服务器。
2. 单击右上角的管理员链接。
3. 转至访问 -> 资源许可权。
4. 针对 My Portal 链接选择指定访问权按钮;在编辑角色屏幕中提供所有已认证的用户访问权并单击确定。
5. 同样,按照步骤(4)的描述,为 Registration 页面提供匿名用户访问权。
1. 在以下配置文件中进行下列与 Logout 相关的更改。
<PortalServer_Root>/shared/app/config/services/ConfigService.properties
# Logout redirect parameters
redirect.logout = true
redirect.logout.url = /wps/myportal
上述更改将在“Logout”链接被单击时将门户网站重定向至 Login 页面。
2. 在以下配置文件中进行下列与 Logout 相关的更改。
<PortalServer_Root>/shared/app/nls/engine_en.properties
<PortalServer_Root>/shared/app/nls/engine.properties
编辑下列条目以将链接名更改为“Register”、“Login”和“Logout”。
link.enrollment = Register
link.login = Sign in
link.logout = Sign out
添加下面这两个条目,这两个条目显示经过定制的欢迎消息。
default_welcome = Welcome!
login_welcome = Welcome, {0}
3. 在以下配置文件中进行与 Login 按钮相关的更改。
<PortalServer_Root>/shared/app/nls/button_en.properties
<PortalServer_Root>/shared/app/nls/button.properties
编辑以下条目以更改链接名“Login”。
login = Sign in
在供应商门户网站的安装与配置期间,我们修改了几个特定于 Portal Server 的配置文件和特定于供应商门户网站应用程序的配置文件。下面提供对这些文件的简要描述。
<PortalServer_root>/config/wpconfig.properties
<PortalServer_root>/wmm/wmmLDAPServerAttributes.xml
<PortalServer_root>/shared/app/config/services/ConfigService.properties
<PortalServer_root>/shared/app/config/services/LoaderService.properties
<PortalServer_root>/shared/app/nls/field.properties
<PortalServer_root>/shared/app/nls/problem.properties
<PortalServer_root>/shared/app/nls/engine.properties
<PortalServer_root>/shared/app/nls/button.properties
特定于供应商门户网站应用程序的配置文件:
<application_root>/WebContent/WEB-INF/config/soapactionurls.xml
<Application_root>/WebContent/WEB-INF/config/timezonevalues.xml
<Application_root>/WebContent/WEB-INF/config/catalog_configuration.xml
<Application_root>/WebContent/WEB-INF/config/portletActions2pages.xml
本章结束时,您应该已经执行了下列任务:
本章提供有关下列各项的详细信息:
下图显示了一般的 portlet 结构。用户在消息区域中得到有关事务状态的通知。用户与“活动”区域以及“活动按钮”区域进行交互。
以下列表提供了可用用户方案的 portlet:
用户注册
a. 在登录页面中,单击 Register 链接。
b. 这就显示了 User Registration Portlet。
c. User Registration portlet 显示了供应商 GLN 和电子邮件地址。用户输入此信息。
d. 单击 Next 按钮以验证 GLN 和电子邮件地址。
e. 系统一旦识别此信息,密码字段就会显示。
f. 系统进行检查以确保密码完全相同。
g. 一个屏幕显示,此屏幕指出将把注册核准信息发送给用户,进行核准后,用户就可以登录到门户网站了。
用户注册核准 - 手工
a. 这是一个脱机过程。WebSphere Product Center 管理员必须对已注册的用户进行核准。这将使他们能够登录到门户网站并使用与 WebSphere Product Center 相关的 portlet。
b. WebSphere Product Center 管理员必须对已注册的用户指定角色。您必须在门户网站服务器与 WebSphere Product Center 共享的 LDAP 存储库中手工执行此操作。这将确保用户有权执行与 WebSphere Product Center 相关的事务。
查看项目录
a. 这个 portlet 以树结构格式列示项目录。项是此目录树中的叶子。
b. 用户选择目录,并可以选择添加项。此选项是操作按钮区域中的一个按钮。
c. 用户选择项,并可以选择查看、编辑、克隆或删除该项。这些选项都是操作按钮区域中的按钮。
d. 这些按钮仅适用于对项执行的操作。
e. 将从 WebSphere Product Center 检索第一级目录。根据用户交互检索子节点(子目录和项);用户展开节点,该节点下的内容显示。这将减少在任何时间点需要装入的数据量,但会增加为了检索此信息而对 WebSphere Product Center 进行的调用次数。
查看现有的项
a. 从 Item Catalog Portlet 中选择项,然后单击 View Item 按钮。这将在“Work with Item”portlet 中显示项详细信息。内容是以只读方式显示的。
添加新项
a. 从“Item Catalog”portlet 中选择目录,然后单击 Add Item 按钮。这将在“Work with Item”portlet 中显示项内容,以便用户可以输入项信息。“添加”操作将输入的项添加到所选目录中。
b. 也可以通过在“Work with Item”portlet 中单击 Add Item 按钮来启动创建项的过程。这将在未指定的目录下创建一个项。
c. 与项条目相关的验证操作是在提交时执行的。第一级验证是根据从 WebSphere Product Center 接收到的属性元信息执行的。这些验证通常是类型检查和范围检查。验证不是在进行 JavaScript 级别检查时执行的。
d. 用户也可以选择取消操作。这将使 portlet 回到它的初始状态。
更新现有的项
a. 从“Item Catalog”portlet 中选择项,然后单击 Update Item 按钮。这将在“Work with Item”portlet 中显示项内容,以便用户可以输入项更新信息。
b. 也可以通过搜索一个项、选择该项并接着在搜索结果中单击 Work with Item 按钮来启动这个项更新过程。这将把项信息填充到“Work with Item”portlet 中。接着,用户可以单击 Update Item 按钮以开始使用这个项。
c. 也可以通过从“Item Catalog”portlet 中选择项并单击 View Item 来启动这个项更新过程。这将对“Work with Item”portlet 进行填充。然后,用户可以单击 Update 按钮。这将以可编辑的方式显示内容。
d. 与项条目相关的验证是在提交时执行的。第一级验证是根据从 WebSphere Product Center 接收到的属性元信息执行的。这些验证通常是类型检查和范围检查。验证不是在进行 JavaScript 级别检查时执行的。
e. 用户也可以选择取消操作。这将使 portlet 回到它的初始状态。
克隆项
a. 从“Item Catalog”portlet 中选择项,然后单击 Clone Item 按钮。这将在“Work with Item”portlet 中显示项内容副本,以便用户可以执行项复制操作。
b. 也可以通过搜索一个项、选择该项并接着在搜索结果中单击 Work with Item 按钮来启动这个项克隆过程。这将把项信息填充到“Work with Item”portlet 中。用户可以单击 Clone 按钮并使用该项。
c. 也可以通过从“Item Catalog”portlet 中选择项并单击 View Item 来启动这个项克隆过程。这将对“Work with Item”portlet 进行填充。然后,用户可以单击 Clone 按钮。这将以可编辑的方式显示内容。
d. 与项条目相关的验证是在提交时执行的。第一级验证是根据从 WebSphere Product Center 接收到的属性元信息执行的。这些验证通常是类型检查和范围检查。验证不是在进行 JavaScript 级别检查时执行的。
e. 用户也可以选择取消操作。这将使 portlet 回到它的初始状态。
除去现有的项
a. 从“Item Catalog”portlet 中选择项,然后单击 Delete Item 按钮。这将在“Work with Item”portlet 中显示项内容,以便用户可以执行项删除操作。项内容是以可读方式显示的。
b. 也可以通过搜索一个项、选择该项并接着在搜索结果中单击 Work with Item 按钮来启动这个项删除过程。这将把项信息填充到“Work with Item”portlet 中。接着,用户可以单击 Delete 按钮并删除该项。
c. 也可以通过从“Item Catalog”portlet 中选择项并单击 View Item 来启动这个项删除过程。这将对“Work with Item”portlet 进行填充。然后,用户可以单击 Delete 按钮。
d. 用户也可以选择取消操作。这将使 portlet 回到它的初始状态。
项搜索
a. 最初,Search portlet 显示了搜索条件值:GTIN、GLN、Target Market、Product Status(Approved、rejected 和 draft 等)、SKU#、Price 以及 Return single item or hierarchy。用户可以执行通配符搜索。
b. Search Criteria 提供了范围条件选项,这些选项具有日期或数字类型。例如,Price 条件将是高于 $100 但低于 $500 的价格。
c. Search Criteria 保存用户最近使用的 10 个搜索条件并列示这些条件。单击此链接将使用这些条件执行搜索。
d. 搜索结果将显示在同一个 portlet 中,并显示在搜索条件下方。返回的搜索结果是根据特定于用户的滚动大小显示的。用户可以使用 portlet 的编辑选项来设置此值。搜索结果大小由 WebSphere Product Center 控制,这主要是从搜索性能角度考虑的。搜索结果的显示由 portlet 控制,这主要是从用户体验角度考虑的。
e. 用户可以从搜索结果中选择单个项并单击 Work With Item 按钮。这将把项信息移至“Work with Item”portlet。
f. 用户可以从搜索结果中选择多个项并单击 Work With Item 按钮。这将把那些项移至“Items Mass-Update”portlet。
成批上载
a. “Mass Upload”portlet 提供了一个文件浏览器界面,此界面可用于将逗号分隔的值(CSV)文件从用户机器上载到 WebSphere Product Center。
b. 由于从 WebSphere Product Center 角度看这是一个长时间运行的事务,所以此事务将以异步方式进行。CSV 文件将被上载到 WebSphere Product Center 中,事务结果将作为门户网站上的消息或通过电子邮件报告给用户。
成批更新
a. 用户使用“Search”portlet 来搜索项,然后选择搜索结果中显示的项并单击 Work with Items 按钮。
b. 这将把所选项的内容传送至“Items Mass-Update”portlet。现在,用户可以针对所选的一组属性执行项成批更新了。
我们选择的消息格式在一定程度上与 UCCNet 消息格式相似。包络含有头和主体。头包含一些信息,这些信息将用来标识发送方/接收方详细信息以及唯一的消息标识。对于请求消息来说,主体包含要执行的命令及相关信息,对于响应消息来说,主体包含响应详细信息。
可以通过两种方法来处理门户网站与 Product Center 之间的消息事务,即异步方式和同步方式。
文档结构
<envelope>
<wpcHeader>
<!— companyName. By default the
user id and company in WPC will be taken from the respective script context.
This will be as of now just for FYI kind of field -->
< companyName></ companyName>
<!—UserID. By default the user
id and company in WPC will be taken from the respective script context. This
will be as of now just for FYI kind of field -->
< userID></ userID>
<!--messageIdentifier uniqely
identifies each message-->
< messageIdentifier></
messageIdentifier>
<!—time stamp at which the
message was sent -- >
<timestamp></timestamp>
<!—supplier ID of the WPS
user -- >
<supplierId></supplierId>
</wpcHeader>
<wpcBody>
< wpcCommand type=ADD mode=SYNC
>
………...
</wpcCommand>
</wpcBody>
</envelope>
wpcCommand 元素的“type”属性可以具有 ADD、MODIFY、DELETE、SEARCH 以及 QUERY_TRANSACTION 等值。此字段确定需要执行的操作。wpcCommand 的“mode”属性确定操作的执行方式。此属性的值可以是 SYNC 或 ASYNC。
在 SYNC 方式下,将对请求 XML 文件进行处理,接着立即生成相应的响应 XML 文档并将其发回。
在 ASYNC 方式下,在接收到 XML 请求文档并确认给定文档有效并且格式正确时,将把一个事务标识发回给调用者。接下来,调用者可以不断地通过提供该事务标识来进行轮询以了解所请求的事务的状态。
要在 Product Center 门户网站中添加目录项,应该发送以下消息框架并填充适当的数据。方式标志应该是“SYNC”以便立即获取响应,而不能是“ASYNC”。
<envelope>
<wpcHeader>
<!— companyName. By default the
user id and company in WPC will be taken from the respective script context.
This will be as of now just for FYI kind of field -->
< companyName></ companyName>
<!—UserID. By default the user
id and company in WPC will be taken from the respective script context. This
will be as of now just for FYI kind of field -->
< userID></ userID>
<!--messageIdentifier uniqely
identifies each message-->
< messageIdentifier></
messageIdentifier>
</wpcHeader>
<wpcBody>
< wpcCommand type=ADD mode=SYNC
>
<wpcCatalogItem>
………...
</wpcCatalogItem>
</wpcCommand>
</wpcBody>
</envelope>
Product Center 发回的相应响应应该是:
<envelope> <wpcHeader> <!— companyName. By default the user id and company in WPC will be taken from the respective script context. This will be as of now just for FYI kind of field --> < companyName></ companyName> <!—UserID. By default the user id and company in WPC will be taken from the respective script context. This will be as of now just for FYI kind of field --> < userID></ userID> <!--messageIdentifier uniqely identifies each message--> < messageIdentifier></ messageIdentifier> </wpcHeader> <wpcBody> < wpcResponse> < wpcEntityIdentifier> <!—messageidentifier value of the request message --!> < wpcMessageIdentifier > </ wpcMessageIdentifier > <!—WPC transaction id created for the request msg --!> < wpcTransactionID ></ wpcTransactionID > </ wpcEntityIdentifier> < wpcNotification > < notificationInfo type=”SUCCESS” > < notificationCode >000</ notificationCode > <notificationMessage>SUCCESS</notificationMessage> </ wpcResponse> </wpcBody> </envelope>
遇到任何错误时,notificationInfo 的“type”属性值将是“ERROR”或“WARNING”,通知节点将包含错误代码,notificaitonMessage 将包含相应的错误消息。这种情况适用于从门户网站发送的所有消息。对于 SEARCH/SELECTION 请求,如果进行的是 SYNC 方式的请求,wpcResponse 将把 wpcCatalogueItem 块作为响应的一部分,这就是搜索/选择结果。
对于 ASYNC 方式的请求,发送的请求消息应该如下所示:
<envelope>
<wpcHeader>
<!— companyName. By default the user id and company in WPC will be taken
from the respective script context. This will be as of now just for FYI kind of
field -->
< companyName></ companyName>
<!—UserID. By default the user id and company in WPC will be taken from the
respective script context. This will be as of now just for FYI kind of field
-->
< userID></ userID>
!--messageIdentifier uniqely identifies each message-->
< messageIdentifier></ messageIdentifier>
</wpcHeader>
<wpcBody>
< wpcCommand type=ADD mode=”ASYNC”>
<!— in case of bulk item operations, below block will be used --!>
<!—as of now only file type supported is CSV --!>
<wpcDataContainer fileType=”CSV”>
<serverName></serverName>
<userName></userName>
<password></password>
<dataDir></dataDir>
<fileName></filename>
</wpcCommand>
</wpcBody>
</envelope>
同一请求的响应如下所示:
<envelope>
<wpcHeader>
<!— companyName. By default the user id and company in WPC will be taken
from the respective script context. This will be as of now just for FYI kind of
field -->
< companyName></ companyName>
<!—UserID. By default the user id and company in WPC will be taken from the
respective script context. This will be as of now just for FYI kind of field
-->
< userID></ userID>
<!--messageIdentifier uniqely identifies each message-->
< messageIdentifier></ messageIdentifier>
</wpcHeader>
<wpcBody>
< wpcResponse>
< wpcEntityIdentifier>
<!—messageidentifier value of the request message --!>
< wpcMessageIdentifier > </ wpcMessageIdentifier >
<!—WPC transaction id created for the request msg --!>
< wpcTransactionID ></ wpcTransactionID >
</ wpcEntityIdentifier>
< wpcNotification >
< notificationInfo type=”PROCESSING” >
< notificationCode >999</ notificationCode >
<notificationMessage>PROCESSING</notificationMessage>
</ wpcResponse>
</wpcBody>
</envelope>
现在,门户网站应该不断地轮询 Product Center 以检查给定事务完成与否。以下消息执行此操作。
<envelope>
<wpcHeader>
<!— companyName. By default the user id and company in WPC will be taken
from the respective script context. This will be as of now just for FYI kind of
field -->
< companyName></ companyName>
<!—UserID. By default the user id and company in WPC will be taken from the
respective script context. This will be as of now just for FYI kind of field
-->
< userID></ userID>
<!--messageIdentifier uniqely identifies each message-->
< messageIdentifier></ messageIdentifier>
</wpcHeader>
<wpcBody>
< wpcCommand type=”QUERY_TRANSACTION” mode=”ASYNC”>
< wpcEntityIdentifier>
<!—messageidentifier value of the request message --!>
< wpcMessageIdentifier > </ wpcMessageIdentifier >
<!—WPC transaction id created for the request msg --!>
< wpcTransactionID ></ wpcTransactionID >
</ wpcEntityIdentifier>
</wpcCommand>
</wpcBody>
</envelope>
现在,Product Center 在操作成功完成时发回的相应响应如下所示:
<envelope>
<wpcHeader>
<!— companyName. By default the user id and company in WPC will be taken
from the respective script context. This will be as of now just for FYI kind of
field -->
< companyName></ companyName>
<!—UserID. By default the user id and company in WPC will be taken from the
respective script context. This will be as of now just for FYI kind of field
-->
< userID></ userID>
<!--messageIdentifier uniqely identifies each message-->
< messageIdentifier></ messageIdentifier>
</wpcHeader>
<wpcBody>
< wpcResponse>
< wpcEntityIdentifier>
<!—messageidentifier value of the request message --!>
< wpcMessageIdentifier > </ wpcMessageIdentifier >
<!—WPC transaction id created for the request msg --!>
< wpcTransactionID ></ wpcTransactionID >
</ wpcEntityIdentifier>
< wpcNotification >
< notificationInfo type=”SUCCESS” >
< notificationCode >000</ notificationCode >
<notificationMessage>SUCCESS</notificationMessage>
</ wpcResponse>
</wpcBody>
</envelope>
当请求仍在处理中时,响应将与 Product Center 接收到 ASYNC 请求后立即发送的响应相同。
本节描述门户网站集成所涉及的脚本和 Web Service。
wpc_portal_integrated_dev
Web Service 实现脚本(/scripts/wbs/wpc_portal_integrated_dev0)
/scripts/triggers/WPC-Portal-RequestUtil.wpcs
/scripts/triggers/WPC-Portal-ResponseUtil.wpcs
/scripts/triggers/WPC-Portal-ItemHelper.wpcs
/scripts/triggers/WPC-Portal-CSVHelper.wpcs
/scripts/triggers/WPC-Portal-ViewHelper.wpcs
下列各节提供了用于调用所给出的命令的样本 XML 消息和相应脚本。
以下给定请求将添加项并提供成功或失败响应。
//
to invoke the item add message
<?xml version="1.0" encoding="UTF-8"?>
<envelope xmlns="http://ibm.com/wpc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibm.com/wpc/
C:\wpc\portal\webservice_dev.xsd" communicationVersion="5.2">
<WPCResponseType>synchronous</WPCResponseType>
<wpcHeader>
<companyName>null</companyName>
<userID>administrator</userID>
<password>null</password>
<messageIdentifier>D5D92CE0-97A8-11D9-B84B-A068E33E0476</messageIdentifier>
<timestamp>2005-03-18</timestamp>
<supplierId>null</supplierId>
</wpcHeader>
<wpcBody>
<wpcCommand type="ADD" mode="SYNC">
<wpcParentCategory>1/5</wpcParentCategory>
<wpcCatalogName> CTG_PORTAL_MASTER</wpcCatalogName>
<wpcTradeItem>
<attribute-list>
<attribute name="Master Item Hier Sec Spec1/name"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Hier Sec Spec1/ID"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/GTIN" type="STRING">
<values>
<value occurrence="0">393939</value>
</values>
</attribute>
<attribute name="Master Item Spec/Internal ID"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Short Description"
type="STRING">
<values>
<value occurrence="0">short description</value>
</values>
</attribute>
<attribute name="Master Item Spec/Long Description"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Thumbnail Preview" type="THUMBNAIL_IMAGE_URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Item Type" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Item Regulation" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Item Source" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Perishable Type" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content"
type="GROUPING">
<values>
<groupvalue>
<attribute name="Master Item Spec/Product Content/Thumbnail Image"
type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Small Thumbnail
Image" type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Print Image"
type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Web Image"
type="IMAGE">
<values>
<file type="" occurrence="0">
<name/>
<dir/>
<server-name/>
<userID/>
<password/>
</file>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/POS Image"
type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Hi-Res Image"
type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Product
Documents"
type="GROUPING">
<values>
<groupvalue>
<attribute name="Master Item Spec/Product Content/Product
Documents/Document" type="URL">
<values>
<value occurrence="0"/>
</values>
</attribute>
</groupvalue>
</values>
</attribute>
</groupvalue>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet"
type="GROUPING">
<values>
<groupvalue>
<attribute name="Master Item Spec/UCCnet/Product Type"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Brand"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Category"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Color"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Consumer Unit"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Coupon Family Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Dated Product - Days"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Detailed Description"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/D-U-N-S"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/EANUCC Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/EANUCC Type"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Effective Date"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/First Arrival"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/First Order"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/First Ship"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Flash Point Temp"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Flash Point Unit"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/GLN"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Gross Weight"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/GTIN"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Class Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Code Qualifier"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Description"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Sequence"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Height"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/HI"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/InnerPack"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Item Description"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Item Status"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Last Arrival"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Last Order"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Last Ship"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Length"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Linear"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Maximum Order"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Maximum Ship"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Minimum Order"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Minimum Ship"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Name"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Net Weight"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Order Increment"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Order Sizing Factor"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Orderable Unit"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Order Increment Units"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Pack"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Page"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Phone"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/POS Desc 1"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/POS Desc 2"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Pre Priced Amount"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Private"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Replaced by GTIN"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Replaces GTIN"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Size"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Size Units"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Special Handling Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Suggested Retail Price"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/TI"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Version"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Version Status"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Volume"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Volume Unit"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Weight"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Width"
type="STRING">
<values>
<value/>
</values>
</attribute>
</groupvalue>
</values>
</attribute>
<attribute name="Master Item Spec/Supplier_ID"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/ItemStatus"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Effective Start Date"
type="DATE">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Effective End Date"
type="DATE">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Last Updated By"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Update on"
type="DATE">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 1"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 2"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 3"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 4"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 5"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/AddedVia" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/ModifiedVia" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Item Price"
type="NUMBER">
<values>
<value occurrence="0">0.0</value>
</values>
</attribute>
<attribute name="Master Item Spec/Item Unit Size"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/testImage"
type="IMAGE">
<values>
<file>
<name/>
</file>
</values>
</attribute>
</attribute-list>
</wpcTradeItem>
</wpcCommand>
</wpcBody>
</envelope>
以下给定请求将修改具有给定主键的项。
//
to invoke MODIFY message
<?xml version="1.0" encoding="UTF-8"?>
<envelope xmlns="http://ibm.com/wpc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibm.com/wpc/
C:\wpc\portal\webservice_dev.xsd" communicationVersion="5.2">
<WPCResponseType>synchronous</WPCResponseType>
<wpcHeader>
<companyName>null</companyName>
<userID>administrator</userID>
<password>null</password>
<messageIdentifier>253667D0-97A9-11D9-B84B-CFE00DAB579A</messageIdentifier>
<timestamp>2005-03-18</timestamp>
<supplierId>null</supplierId>
</wpcHeader>
<wpcBody>
<wpcCommand type="MODIFY" mode="SYNC">
<wpcParentCategory>1/5</wpcParentCategory>
<wpcCatalogName> CTG_PORTAL_MASTER</wpcCatalogName>
<wpcTradeItem ID="393939">
<attribute-list>
<attribute name="Master Item Hier Sec Spec1/name"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Hier Sec Spec1/ID"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/GTIN" type="STRING">
<values>
<value occurrence="0">393939</value>
</values>
</attribute>
<attribute name="Master Item Spec/Internal ID"
type="STRING">
<values>
<value occurrence="0">23</value>
</values>
</attribute>
<attribute name="Master Item Spec/Short Description"
type="STRING">
<values>
<value occurrence="0">short description</value>
</values>
</attribute>
<attribute name="Master Item Spec/Long Description"
type="STRING">
<values>
<value occurrence="0">23</value>
</values>
</attribute>
<attribute name="Master Item Spec/Thumbnail Preview" type="THUMBNAIL_IMAGE_URL">
<values>
<value occurrence="0">http://23</value>
</values>
</attribute>
<attribute name="Master Item Spec/Item Type" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Item Regulation" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Item Source" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Perishable Type" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content"
type="GROUPING">
<values>
<groupvalue>
<attribute name="Master Item Spec/Product Content/Thumbnail Image"
type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Small Thumbnail
Image" type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Print Image"
type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Web Image"
type="IMAGE">
<values>
<file type="" occurrence="0">
<name/>
<dir/>
<server-name/>
<userID/>
<password/>
</file>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/POS Image"
type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Hi-Res Image"
type="URL">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Product Content/Product
Documents" type="GROUPING">
<values>
<groupvalue>
<attribute name="Master Item Spec/Product Content/Product
Documents/Document" type="URL">
<values>
<value occurrence="0"/>
</values>
</attribute>
</groupvalue>
</values>
</attribute>
</groupvalue>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet"
type="GROUPING">
<values>
<groupvalue>
<attribute name="Master Item Spec/UCCnet/Product Type"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Brand"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Category"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Color"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Consumer Unit"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Coupon Family Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Dated Product - Days"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Detailed Description"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/D-U-N-S"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/EANUCC Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/EANUCC Type"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Effective Date"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/First Arrival"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/First Order"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/First Ship"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Flash Point Temp"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Flash Point Unit"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/GLN"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Gross Weight"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/GTIN"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Class Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Code Qualifier"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Description"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Hazmat Sequence"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Height"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/HI"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/InnerPack"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Item Description"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Item Status"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Last Arrival"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Last Order"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Last Ship"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Length"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Linear"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Maximum Order"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Maximum Ship"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Minimum Order"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Minimum Ship"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Name"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Net Weight"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Order Increment"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Order Sizing Factor"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Orderable Unit"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Order Increment Units"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Pack"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Page"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Phone"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/POS Desc 1"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/POS Desc 2"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Pre Priced Amount"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Private"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Replaced by GTIN"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Replaces GTIN"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Size"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Size Units"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Special Handling Code"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Suggested Retail Price"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/TI"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Version"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Version Status"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Volume"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Volume Unit"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Weight"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/UCCnet/Width"
type="STRING">
<values>
<value/>
</values>
</attribute>
</groupvalue>
</values>
</attribute>
<attribute name="Master Item Spec/Supplier_ID"
type="STRING">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/ItemStatus"
type="STRING">
<values>
<value occurrence="0">232</value>
</values>
</attribute>
<attribute name="Master Item Spec/Effective Start Date"
type="DATE">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Effective End Date"
type="DATE">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Last Updated By"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Update on"
type="DATE">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 1"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 2"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 3"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 4"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/Comment 5"
type="STRING">
<values>
<value occurrence="0"/>
</values>
</attribute>
<attribute name="Master Item Spec/AddedVia" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/ModifiedVia" type="STRING_ENUMERATION">
<values>
<value/>
</values>
</attribute>
<attribute name="Master Item Spec/Item Price"
type="NUMBER">
<values>
<value occurrence="0">0.0</value>
</values>
</attribute>
<attribute name="Master Item Spec/Item Unit Size"
type="STRING">
<values>
<value occurrence="0">23</value>
</values>
</attribute>
<attribute name="Master Item Spec/testImage"
type="IMAGE">
<values>
<file>
<name/>
</file>
</values>
</attribute>
</attribute-list>
</wpcTradeItem>
</wpcCommand>
</wpcBody>
</envelope>
删除具有给定主键的给定项。
//
to invoke DELETE message
var strXML = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>" +
"<wpc:envelope xmlns:wpc=\"http://ibm.com/wpc/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://ibm.com/wpc/
C:\vrprabu\5.2\xsd\portalschema\wpc\5.2_siva\envelop_portal.xsd\"
communicationVersion=\"5.2\"> " +
" <wpc:WPCResponseType>synchronous</wpc:WPCResponseType>"
+
" <wpc:wpcHeader>" +
" <wpc:companyName>IBM</wpc:companyName>" +
" <wpc:userID>Admin</wpc:userID>" +
" <wpc:password>trinitron</wpc:password>" +
" <wpc:messageIdentifier>12344</wpc:messageIdentifier>" +
" <wpc:timestamp>2004-10-10</wpc:timestamp>" +
" </wpc:wpcHeader>" +
" <wpc:wpcBody>" +
" <wpc:wpcCommand type=\"DELETE\"
mode=\"SYNC\">" +
" <wpc:wpcParentCategory>Hierarchy1/Category1</wpc:wpcParentCategory>"
+
" <wpc:wpcCatalogName>CTG_PORTAL</wpc:wpcCatalogName>" +
" <wpc:wpcTradeItem ID=\"173\">" +
" </wpc:wpcTradeItem>" +
" </wpc:wpcCommand>" +
" </wpc:wpcBody>" +
"</wpc:envelope>";
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
可以在此搜索消息中使用高级选择所支持的所有搜索参数类型。请查阅 WSDL 以了解每个搜索条件的更多消息格式。
var
strXML = "<wpc:envelope xmlns:wpc='http://ibm.com/wpc/'
communicationVersion='5.2'>" +
"<wpc:WPCResponseType>synchronous</wpc:WPCResponseType>" +
" <wpc:wpcHeader>" +
" <wpc:companyName>ibm</wpc:companyName>" +
" <wpc:userID>admin</wpc:userID>" +
" <wpc:password>admin</wpc:password>" +
" <wpc:messageIdentifier>C815A530-9077-11D9-A530-E0AE7B025BD4</wpc:messageIdentifier>"
+
" <wpc:timestamp>2005-03-09</wpc:timestamp>" +
" <wpc:supplierId>1236868684668</wpc:supplierId>" +
" </wpc:wpcHeader>" +
" <wpc:wpcBody>" +
" <wpc:wpcCommand type=\"SEARCH\" mode=\"SYNC\"
>" +
" <wpc:wpcCatalogName>CTG_PORTAL_MASTER</wpc:wpcCatalogName>"
+
" <wpc:wpcResultCount>2</wpc:wpcResultCount>" +
" <wpc:wpcSearchCriteria>" +
" <wpc:wpcSearchOperator name=\"AND\">" +
" <wpc:wpcSearchOperator name=\"AND\">" +
" <wpc:wpcSearchElement>" +
" <wpc:wpcAttributePath>Master Item Spec/GTIN</wpc:wpcAttributePath>"
+
" <wpc:wpcAttributeValue></wpc:wpcAttributeValue>" +
" <wpc:wpcAttributeNotPredicate>1</wpc:wpcAttributeNotPredicate>"
+
" <wpc:wpcSearchElementOperator>ISEMPTY</wpc:wpcSearchElementOperator>"
+
" </wpc:wpcSearchElement>" +
" </wpc:wpcSearchOperator>" +
" </wpc:wpcSearchOperator>" +
" </wpc:wpcSearchCriteria>" +
" </wpc:wpcCommand>" +
" </wpc:wpcBody>" +
"</wpc:envelope>";
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
此消息将返回给定目录的主规范,如果存在类别信息,并且有任何项类别规范与该类别相关,就会发回该信息作为响应。
//
to invoke the ITEMSKELETON message
var strXML = "<wpc:envelope xmlns:wpc=\"http://ibm.com/wpc/\"
communicationVersion=\"5.2\">" +
" <wpc:WPCResponseType>synchronous</wpc:WPCResponseType>"
+
" <wpc:wpcHeader>"+
" <wpc:companyName>carmel</wpc:companyName>" +
" <wpc:userID>Admin</wpc:userID>" +
" <wpc:password>trinitron</wpc:password>" +
" <wpc:messageIdentifier>12345</wpc:messageIdentifier>" +
" <wpc:timestamp>2004-12-13</wpc:timestamp>" +
" </wpc:wpcHeader> " +
" <wpc:wpcBody> " +
" <wpc:wpcCommand type=\"ITEMSKELETON\"
mode=\"SYNC\"> " +
" <wpc:wpcCatalogName>CTG_PORTAL_MASTER</wpc:wpcCatalogName>"
+
" </wpc:wpcCommand>" +
" </wpc:wpcBody>" +
"</wpc:envelope>";
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
此命令将由 WPC Web Service 框架本身处理,而不会由相应的脚本实现处理。Web Service 框架将为每个 ASYNC 请求提供唯一的事务标识。当 WPS 发送包含给定事务标识的查询事务详细信息消息时,框架将负责发回由实现脚本生成的响应。
//
to invoke QUERY_TRANSACTION_DETAILS message
<ibm:envelope xmlns:ibm="http://ibm.com/wpc/"
communicationVersion="5.2">
<ibm:WPCResponseType>synchronous</ibm:WPCResponseType>
<ibm:wpcHeader>
<ibm:companyName>String</ibm:companyName>
<ibm:userID>String</ibm:userID>
<ibm:password>String</ibm:password>
<ibm:messageIdentifier>1242432</ibm:messageIdentifier>
<ibm:timestamp>1967-08-13</ibm:timestamp>
</ibm:wpcHeader>
<ibm:wpcBody>
<ibm:wpcCommand type="QUERY_TRANSACTION_DETAILS"
mode="SYNC">
<ibm:wpcTransactionID>99</ibm:wpcTransactionID>
</ibm:wpcCommand>
</ibm:wpcBody>
</ibm:envelope>
这是一个轮询消息(ASYNC 消息),用户定时发送此消息以了解具有给定事务标识的事务完成与否。此消息也将由 Web Service 框架处理,而不会由实现脚本处理。
//
to invoke QUERY_TRANSACTION_STATUS message
<ibm:envelope xmlns:ibm="http://ibm.com/wpc/"
communicationVersion="5.2">
<ibm:WPCResponseType>synchronous</ibm:WPCResponseType>
<ibm:wpcHeader>
<ibm:companyName>String</ibm:companyName>
<ibm:userID>String</ibm:userID>
<ibm:password>String</ibm:password>
<ibm:messageIdentifier>1242432</ibm:messageIdentifier>
<ibm:timestamp>1967-08-13</ibm:timestamp>
</ibm:wpcHeader>
<ibm:wpcBody>
<ibm:wpcCommand type="QUERY_TRANSACTION_STATUS"
mode="SYNC">
<ibm:wpcTransactionID>99</ibm:wpcTransactionID>
</ibm:wpcCommand>
</ibm:wpcBody>
</ibm:envelope>
上载文件
要上载作为 Web Service 附件发送的文件,响应实现脚本将把上载的文件复制到文档库中相应的 supplier/ctg_files 文件夹中,并且将发回当前文档库路径。
//
to invoke the UPLOAD_FILE message with out attachments
var strXML = "<wpc:envelope xmlns:wpc=\"http://ibm.com/wpc/\"
communicationVersion=\"5.2\">" +
"<wpc:WPCResponseType>synchronous</wpc:WPCResponseType>" +
" <wpc:wpcHeader>" +
" <wpc:companyName>null</wpc:companyName>" +
" <wpc:userID>wpsadmin</wpc:userID>" +
" <wpc:password>null</wpc:password>" +
" <wpc:messageIdentifier>C71125E0-8002-11D9-BDC3-93DA3F31311D</wpc:messageIdentifier>"
+
" <wpc:timestamp>2005-02-16</wpc:timestamp>" +
" <wpc:supplierId>null</wpc:supplierId>" +
" </wpc:wpcHeader>" +
"<wpc:wpcBody>" +
" <wpc:wpcCommand type=\"UPLOAD_FILE\"
mode=\"SYNC\">" +
" <wpc:wpcDataContainer>" +
" <wpc:wpcAttachmentsDataContainer>" +
" <wpc:FileName>xyz.jpg</wpc:FileName>" +
" </wpc:wpcAttachmentsDataContainer>" +
" </wpc:wpcDataContainer>" +
" </wpc:wpcCommand>" +
"</wpc:wpcBody>" +
"</wpc:envelope>";
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
在调用此命令文件之前,将使用上载命令来上载包含所需数据的 CSV 文件,然后将发送带有所上载的文件的文档库路径的导入消息,实现脚本将处理同一消息以添加或更新相应的记录。
//
to invoke the IMPORT message with out attachments
var strXML = "<wpc:envelope xmlns:wpc=\"http://ibm.com/wpc/\"
communicationVersion=\"5.2\">" +
"<wpc:WPCResponseType>asynchronous</wpc:WPCResponseType>"
+
" <wpc:wpcHeader>" +
" <wpc:companyName>null</wpc:companyName>" +
" <wpc:userID>wpsadmin</wpc:userID>" +
" <wpc:password>null</wpc:password>" +
" <wpc:messageIdentifier>C71125E0-8002-11D9-BDC3-93DA3F31311D</wpc:messageIdentifier>"
+
" <wpc:timestamp>2005-02-16</wpc:timestamp>" +
" <wpc:supplierId>null</wpc:supplierId>" +
" </wpc:wpcHeader>" +
"<wpc:wpcBody>" +
" <wpc:wpcCommand type=\"IMPORT\" mode=\"ASYNC\">"
+
"<wpc:wpcFileDocStorePath>public_html/ctg_files/1108730965078_15.3KB.1.csv</wpc:wpcFileDocStorePath>"
+
" </wpc:wpcCommand>" +
"</wpc:wpcBody>" +
"</wpc:envelope>";
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
用来获取所有项属性(如果适用的话,还包括类别)。
//
to get the item detail
<wpc:envelope xmlns:wpc="http://ibm.com/wpc/" communicationVersion="5.2">
<wpc:WPCResponseType>synchronous</wpc:WPCResponseType>
<wpc:wpcHeader>
<wpc:companyName>IBM</wpc:companyName>
<wpc:userID>Admin</wpc:userID>
<wpc:password>trinitron</wpc:password>
<wpc:messageIdentifier>12343</wpc:messageIdentifier>
<wpc:timestamp>2004-12-10</wpc:timestamp>
<wpc:supplierId>2348623864826</wpc:supplierId>
</wpc:wpcHeader>
<wpc:wpcBody>
<wpc:wpcCommand type="ITEMDETAIL" mode="ASYNC">
<wpc:wpcParentCategory>1/5</wpc:wpcParentCategory>
<wpc:wpcCatalogName>CTG_PORTAL_MASTER</wpc:wpcCatalogName>
<wpc:wpcTradeItem ID="111225868"></wpc:wpcTradeItem>
</wpc:wpcCommand>
</wpc:wpcBody>
</wpc:envelope>
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
此消息将返回不带任何主键值的项详细信息响应。
//
to invoke clone item message
// to get the item detail
<wpc:envelope xmlns:wpc="http://ibm.com/wpc/" communicationVersion="5.2">
<wpc:WPCResponseType>synchronous</wpc:WPCResponseType>
<wpc:wpcHeader>
<wpc:companyName>IBM</wpc:companyName>
<wpc:userID>Admin</wpc:userID>
<wpc:password>trinitron</wpc:password>
<wpc:messageIdentifier>12343</wpc:messageIdentifier>
<wpc:timestamp>2004-12-10</wpc:timestamp>
<wpc:supplierId>2348623864826</wpc:supplierId>
</wpc:wpcHeader>
<wpc:wpcBody>
<wpc:wpcCommand type="CLONEITEM" mode="ASYNC">
<wpc:wpcParentCategory>1/5</wpc:wpcParentCategory>
<wpc:wpcCatalogName>CTG_PORTAL_MASTER</wpc:wpcCatalogName>
<wpc:wpcTradeItem ID="111225868"></wpc:wpcTradeItem>
</wpc:wpcCommand>
</wpc:wpcBody>
</wpc:envelope>
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
此命令将通过响应返回给定目录的当前类别中的所有子类别和项,如果在请求消息中未提供类别树信息,则返回主类别树中的信息。
//
to invoke the QUERY_CATALOG_CHILDREN message
var strXML = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>" +
"<wpc:envelope xmlns:wpc=\"http://ibm.com/wpc/\"
communicationVersion=\"5.2\"> " +
"<wpc:WPCResponseType>synchronous</wpc:WPCResponseType>"
+
"<wpc:wpcHeader>" +
"<wpc:companyName>ibm</wpc:companyName>" +
"<wpc:userID>portaluser</wpc:userID>" +
"<wpc:password>password</wpc:password>" +
"<wpc:messageIdentifier>A2473730-5D85-11D9-BF8A-BC1A417CAB44</wpc:messageIdentifier>"
+
"<wpc:timestamp>2005-01-03</wpc:timestamp>" +
"</wpc:wpcHeader>" +
"<wpc:wpcBody>" +
"<wpc:wpcCommand type=\"QUERY_CATALOG_CHILDREN\"
mode=\"SYNC\">" +
"<wpc:wpcParentCategory>1/5</wpc:wpcParentCategory>" +
"<wpc:wpcCatalogName>CTG_PORTAL</wpc:wpcCatalogName>" +
"<wpc:wpcHierarchyName name=\"Hier_Portal\"
type=\"PRIMARY\"/>" +
"</wpc:wpcCommand>" +
"</wpc:wpcBody>" +
"</wpc:envelope>";
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
此消息将获取 WPC 中当前包含的所有目录并发送同一内容作为响应。
//
to invoke the GET_CATALOGS message type
var strXML = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>" +
"<wpc:envelope xmlns:wpc=\"http://ibm.com/wpc/\"
communicationVersion=\"5.2\"> " +
"<wpc:WPCResponseType>synchronous</wpc:WPCResponseType>"
+
"<wpc:wpcHeader>" +
"<wpc:companyName>ibm</wpc:companyName>" +
"<wpc:userID>portaluser</wpc:userID>" +
"<wpc:password>password</wpc:password>" +
"<wpc:messageIdentifier>A2473730-5D85-11D9-BF8A-BC1A417CAB44</wpc:messageIdentifier>"
+
"<wpc:timestamp>2005-01-03</wpc:timestamp>" +
"</wpc:wpcHeader>" +
"<wpc:wpcBody>" +
"<wpc:wpcCommand type=\"GET_CATALOGS\"
mode=\"SYNC\"/>" +
"</wpc:wpcBody>" +
"</wpc:envelope>";
var resp = invokeSoapServerForDocLit("<respective
webservice URL>",strXML);
var respLog = createOtherOut("Response.xml"); // This
will have the transaction id. Check /scripts/soap/messages/response/<TXN_ID>
for the actual response.
respLog.writeln(resp);
respLog.save("Response.xml");
在 XML 响应中返回指定的视图。Product Center 目前未使用此消息。
此消息以附件形式返回相应的被请求响应。
//
to invoke the GET_RESOURCE message
<?xml version="1.0" encoding="UTF-8"?>
<envelope xmlns="http://ibm.com/wpc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibm.com/wpc/
C:\wpc\portal\webservice_dev.xsd" communicationVersion="5.2">
<WPCResponseType>synchronous</WPCResponseType>
<wpcHeader>
<companyName>null</companyName>
<userID>administrator</userID>
<password>null</password>
<messageIdentifier>1D3589B0-97AB-11D9-B84B-AED0CDB181F1</messageIdentifier>
<timestamp>2005-03-18</timestamp>
<supplierId>null</supplierId>
</wpcHeader>
<wpcBody>
<wpcCommand type="GET_RESOURCE" mode="SYNC">
<wpcParentCategory>9/11</wpcParentCategory>
<wpcCatalogName>CTG_PORTAL_MASTER</wpcCatalogName>
<wpcHierarchyName type="PRIMARY" name="null"/>
<wpcTradeItem ID="1732">
<attribute-list>
<attribute name="Master Item Spec/Product Content/Web Image"
type="IMAGE"/>
</attribute-list>
</wpcTradeItem>
</wpcCommand>
</wpcBody>
</envelope>
IBM 可能不在所有国家或地区提供本文档中讨论的产品、服务或功能特性。有关您当前所在区域的产品和服务的信息,请向您当地的 IBM 代表咨询。任何对 IBM 产品、程序或服务的引用并非意在明示或暗示只能使用 IBM 的产品、程序或服务。只要不侵犯 IBM 的知识产权,任何同等功能的产品、程序或服务,都可以代替 IBM 产品、程序或服务。但是,评估和验证任何非 IBM 产品、程序或服务,则由用户自行负责。
IBM 公司可能已拥有或正在申请与本文档内容有关的各项专利。提供本文档并未授予用户使用这些专利的任何许可。您可以用书面方式将许可查询寄往:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
本条款不适用英国或任何这样的条款与当地法律不一致的国家或地区:
International Business Machines Corporation“按现状”提供本出版物,不附有任何种类的(无论是明示的还是暗含的)保证,包括但不限于暗含的有关非侵权、适销和适用于某种特定用途的保证。某些国家或地区在某些交易中不允许免除明示或暗含的保证。因此本条款可能不适用于您。
本信息中可能包含技术方面不够准确的地方或印刷错误。此处的信息将定期更改;这些更改将编入本资料的新版本中。IBM 可以随时对本资料中描述的产品和/或程序进行改进和/或更改,而不另行通知。
本信息中对非 IBM Web 站点的任何引用都只是为了方便起见才提供的,不以任何方式充当对那些 Web 站点的保证。那些 Web 站点中的资料不是 IBM 产品资料的一部分,使用那些 Web 站点带来的风险将由您自行承担。
IBM 可以按它认为适当的任何方式使用或分发您所提供的任何信息而无须对您承担任何责任。
本程序的被许可方如果要了解有关程序的信息以达到如下目的:(i)允许在独立创建的程序和其他程序(包括本程序)之间进行信息交换,以及(ii)允许对已经交换的信息进行相互使用,请与下列地址联系:
IBM Burlingame Laboratory
Director IBM Burlingame Laboratory
577 Airport Blvd., Suite 800
Burlingame, CA 94010
U.S.A
只要遵守适当的条件和条款,包括某些情形下的一定数量的付费,都可获得这方面的信息。
本资料中描述的许可程序及其所有可用的许可资料均由 IBM 依据 IBM 客户协议、IBM 国际软件许可协议或任何同等协议中的条款提供。
此处包含的任何性能数据都是在受控环境中测得的。因此,在其他操作环境中获得的数据可能会有明显的不同。有些测量可能是在开发级的系统上进行的,因此不保证与一般可用系统上进行的测量结果相同。此外,有些测量是通过推算而估计的,实际结果可能会有差异。本文档的用户应当验证其特定环境的适用数据。
涉及非 IBM 产品的信息可从这些产品的供应商、其出版说明或其他可公开获得的资料中获取。IBM 没有对这些产品进行测试,也无法确认其性能的精确性、兼容性或任何其他关于非 IBM 产品的声明。有关非 IBM 产品性能的问题应当向这些产品的供应商提出。
本信息可能包含日常业务经营中使用的数据和报告的示例。为了尽可能完整地说明这些示例,这些示例中包括个人、公司、品牌和产品的名称。所有这些人名或名称均系虚构,如有实际的企业名称和地址与此雷同,纯属巧合。
所有关于 IBM 未来方向或意向的声明都可随时更改或收回,而不另行通知,它们仅仅表示了目标和意愿而已。
如果提供了编程接口信息,它用来帮助您使用此程序来创建应用软件。
通用编程接口允许您编写获取此程序工具的服务的应用软件。
但是,此信息也可能包含诊断、修改和调整信息。这些诊断、修改和调整信息用于帮助您调试应用软件。
警告:不要将此诊断、修改和调整信息用作编程接口,因为它是会更改的。
下列各项是 International Business Machines Corporation 在美国和/或其他国家或地区的商标或注册商标:
IBM
IBM logo
AIX
CrossWorlds
DB2
DB2 Universal Database
Domino
Lotus
Lotus Notes
MQIntegrator
MQSeries
Tivoli
WebSphere
Microsoft、Windows、Windows NT 和 Windows 徽标是 Microsoft Corporation 在美国和/或其他国家或地区的商标。
MMX、Pentium 和 ProShare 是 Intel Corporation 在美国和/或其他国家或地区的商标或注册商标。
Java 和所有基于 Java 的商标是 Sun Microsystems, Inc. 在美国和/或其他国家或地区的商标。
其他公司、产品或服务名称可能是其他公司的商标或服务标记。
IBM WebSphere Product Center contains certain Excluded Components (as defined
in the relevant License Information document), to which the following additional
terms apply. This software is licensed to you under the terms and conditions of
the International Program License Agreement, subject to its Excluded Components
provisions. IBM is required to provide the following notices to you in
connection with this softwatre:
i.) IBM WebSphere Product Center includes the following software that was
licensed by IBM from the Apache Software Foundation under the terms and
conditions of the Apache 2.0 license:
- Apache Regular Expression v1.2
- Apache Axis v1.1
- Apache XML4J v3.0.1
- Apache Log4j v1.1.1
- Apache Jakarta Commons DBCP Package v1.1
- Apache Jakarta Commons Pool Package v1.1
- Apache Jakarta Commons Collections Package v3.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION,
AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the
copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all ther
entities that control, are controlled by, or are under common control with that
entity. For the purposes of this definition, "control" means (i) the
power, direct or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or
more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source, and
configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation, and conversions to
other media types.
"Work" shall mean the work of authorship, whether in Source or Object
form, made available under the License, as indicated by a copyright notice that
is included in or attached to the work (an example is provided in the Appendix
below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the editorial
revisions, annotations, elaborations, or other modifications represent, as a
whole, an original work of authorship. For the purposes of this License,
Derivative Works shall not include works that remain separable from, or merely
link (or bind by name) to the interfaces of, the Work and Derivative Works
thereof.
"Contribution" shall mean any work of authorship, including the
original version of the Work and any modifications or additions to that Work or
Derivative Works thereof, that is intentionally submitted to Licensor for
inclusion in the Work by the copyright owner or by an individual or Legal Entity
authorized to submit on behalf of the copyright owner. For the purposes of this
definition, "submitted" means any form of electronic, verbal, or
written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this
License, each Contributor hereby grants to You a perpetual, worldwide,
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
reproduce, prepare Derivative Works of, publicly display, publicly perform,
sublicense, and distribute the Work and such Derivative Works in Source or
Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License,
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as stated in this section) patent
license to make, have made, use, offer to sell, sell, import, and otherwise
transfer the Work, where such license applies only to those patent claims
licensable by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s) with the Work
to which such Contribution(s) was submitted. If You institute patent litigation
against any entity (including a cross-claim or counterclaim in a lawsuit)
alleging that the Work or a Contribution incorporated within the Work
constitutes direct or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate as of the date
such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or
Derivative Works thereof in any medium, with or without modifications, and in
Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of
this License; and
(b) You must cause any modified files to carry prominent notices stating that
You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You
distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work, excluding those notices
that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained within such NOTICE
file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one of the following
places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or documentation, if
provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and wherever such
third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside or as an addendum
to the NOTICE text from the Work, provided that such additional attribution
notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any
Contribution intentionally submitted for inclusion in the Work by You to the
Licensor shall be under the terms and conditions of this License, without any
additional terms or conditions. Notwithstanding the above, nothing herein shall
supersede or modify the terms of any separate license agreement you may have
executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names,
trademarks, service marks, or product names of the Licensor, except as required
for reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible
for determining the appropriateness of using or redistributing the Work and
assume any risks associated with Your exercise of permissions under this
License.
8. Limitation of Liability. In no event and under no legal theory, whether in
tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly negligent
acts) or agreed to in writing, shall any Contributor be liable to You for
damages, including any direct, indirect, special, incidental, or consequential
damages of any character arising as a result of this License or out of the use
or inability to use the Work (including but not limited to damages for loss of
goodwill, work stoppage, computer failure or malfunction, or any and all other
commercial damages or losses), even if such Contributor has been advised of the
possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or
Derivative Works thereof, You may choose to offer, and charge a fee for,
acceptance of support, warranty, indemnity, or other liability obligations
and/or rights consistent with this License. However, in accepting such
obligations, You may act only on Your own behalf and on Your sole
responsibility, not on behalf of any other Contributor, and only if You agree to
indemnify, defend, and hold each Contributor harmless for any liability incurred
by, or claims asserted against, such Contributor by reason of your accepting any
such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include the brackets!)
The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a file or class name
and description of purpose be included on the same "printed page" as
the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may obtain a
copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
for the specific language governing permissions and limitations under the
License.
ii.) IBM WebSphere Product Center includes the following software that was
licensed by IBM from Scott Hudson, Frank Flannery and C. Scott Ananian under the
following terms and conditions:
- Cup Parser Generator v0.10k
CUP Parser Generator Copyright Notice,
License, and Disclaimer
Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian
Permission to use, copy, modify, and
distribute this software and its documentation for any purpose and without fee
is hereby granted, provided that the above copyright notice appear in all copies
and that both the copyright notice and this permission notice and warranty
disclaimer appear in supporting documentation, and that the names of the authors
or their employers not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.The authors and their employers disclaim all
warranties with regard to this software, including all implied warranties of
merchantability and fitness. In no event shall the authors or their employers be
liable for any special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether in an action of
contract, negligence or other tortious action, arising out of or in connection
with the use or performance of this software.
iii.) IBM WebSphere Product Center includes the following software that was
licensed by IBM from Elliot Joel Berk and C. Scott Ananian under the following
terms and conditions:
- JLex v1.2.6
JLEX COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.
Copyright 1996-2003 by Elliot Joel Berk and C. Scott Ananian
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided that
the above copyright notice appear in all copies and that both the copyright
notice and this permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the authors or their employers not be used
in advertising or publicity pertaining to distribution of the software without
specific, written prior permission. The authors and their employers disclaim all
warranties with regard to this software, including all implied warranties of
merchantability and fitness. In no event shall the authors or their employers be
liable for any special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether in an action of
contract, negligence or other tortious action, arising out of or in connection
with the use or performance of this software. Java is a trademark of Sun
Microsystems, Inc. References to the Java programming language in relation to
JLex are not meant to imply that Sun endorses this product.
iv.) IBM WebSphere Product Center includes the following software that was
licensed by IBM from International Business Machines Corporation and others
under the following terms and conditions:
- ICU4J v2.8
ICU License - ICU 1.8.1 and later
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1995-2003 International Business Machines Corporation and others
All
rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
provided that the above copyright notice(s) and this permission notice appear in
all copies of the Software and that both the above copyright notice(s) and this
permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization of the copyright holder.
-----------------------------------------------------------------------------
All trademarks and registered trademarks mentioned herein are the property of
their respective owners.