WebSphere Product Center:入口網站支援
5.2 版
請注意! 在使用本資訊及其支援的產品前,請先閱讀本文件尾端的注意事項資訊。
2005 年 3 月 21 日
本文件的這個版本適用於 WebSphere Product Center 5.2 版 (5724-I68) 及所有後續版本和修訂,除非新版中另有指示。
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 服務功能
資料
Product Center 要求和回應資料
項目規格
元件
Product Center 調節器
Web 服務介面
資料轉換器
資料類型
資料 Bean
使用者介面元件
資料交換服務
服務
國際化/區域化支援
安全支援
資源
使用 LDAP 配置 Portal Server 安全
配置 LDAP 的資料庫
配置 LDAP 的資料庫
新增字尾
建立入口網站使用者
配置入口網站
建立入口網站管理使用者
自訂供應商入口網站的登入服務
Product Center 配置
結論
資源
第 4 章 - 建立 Product Center Portlet
範例 Portlet - WorkWithItem
XML 訊息
代表項目的資料物件
XMLGenerator 和 XMLParser
新增方法至 Product Center 調節器
建立 Portlet
指向 Product Center Server 的 Web 服務
部署供應商入口網站
自訂供應商入口網站的 UI
建立導覽功能表
安裝主題和面板
以標籤佈置 Portlet
提供標籤的存取權限
更新配置檔
配置檔
結論
第 6 章 - 使用者介面組織架構
Portlet 結構
Portlet 庫存
第 7 章 - 訊息格式概觀
相關 Script 和 Web 服務的概觀
不同訊息格式
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 未提供任何產品資訊管理 (Product Information Management) Portlet。 不過,WebSphere Product Center 提供支援 Portlet 和供應商入口網站使用者介面開發所需的 API 和 Meta 資料。
本章說明如何建立 IBM WebSphere Product Center(以下稱為 Product Center)的 Portlet。 其中說明提供 Product Center 使用者介面的架構。
整合組織架構支援在 Product Center 中使用 Portlet,讓使用者檢視和使用 Product Center 資訊。 使用者介面組織架構和 Product Center 之間的整合,以 Product Center 的 Web 服務支援為基礎。
架構包含的 Portlet 透過 Product Center 提供的 Web 服務介面與 Product Center 通訊(請參閱圖 1)。 Product Center 提供 Scripting 層,可以作為 API 層使用。 這些 Script 可進一步顯示為 Web 服務。Product Center 中需要公開的每一項商業功能會建立 Web 服務。 也會建立相對應的 Portlet,與此 Web 服務互動。Web 服務會在 Product Center 上執行一或多個 Script, 也會搭配其他 Web 服務,提供所需的商業功能。Web 服務在 Script 和其他 Web 服務之間會執行必要的編排,達成下列目標:
圖 1
入口網站整合。XML 文件為資料轉送模式,將立即或稍候傳送回應,視已接收的要求訊息模式而定。 下圖 2 解說整體架構。
圖 2
Product Center 和 WebSphere Portal Server 之間的通訊一律為 doc-literal 形式的 XML 文件轉換。 ASYNC / SYNC 交易的維護以 Product Center Web 服務組織架構為主,不應該依賴實作 Script 層次。 由於這樣的機能,不須變更任何 Script,任何作業隨時可以變成 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 服務互動。調節器扮演這幾層的單一聯絡點,也執行必要的資料轉換供這兩層使用。 「調節器」以介面形式公開給 Portlet 使用。
Web 服務的連結是透過 AXIS Web Services 呼叫組織架構來完成。 Web 服務層和 AXIS 用戶端會互動,在 Product Center 上起始相對應的 Web 服務呼叫。 Web 服務呼叫為 doc-literal 類型,以 SOAP 作為溝通的通訊協定,目前是透過 HTTP 傳輸來執行。 目前的 Web 服務層用於交換 XML 資料,也用於上傳和下載附件。 AXIS 的 SOAP-with-Attachments (SwA) 實作方式用途在此。 如需 AXIS 組織架構的相關資訊,請參閱本章的「資源」。
配置檔存放 Web 服務清單,使用者介面的動作需要呼叫這些 Web 服務。 動作和 Web 服務的對映如下:
表 3:動作和 Web 服務的對映
<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 中提取或儲存資料。 主要使用者介面元件是 Portlet 和標示庫,標示庫協助呈現 Portlet 的使用者介面。
圖 3
部署在 Portal Server 的 Portlet 沒有很精確的方式來交換資訊,尤其當 Portlet 跨越不同頁面呈現時,更顯粗糙。 Portlet 之間的通訊僅限於相同頁面上呈現的 Portlet。 資料交換服務為所有 Portlet 提供單一聯絡點,有能力保存資訊,Portlet 可以利用此服務來交換資料。 此服務目前僅單獨存在,採取簡單的 Java 方法來呼叫。此服務將進一步擴充來服務更多種類型的物件交換, 也將以獨立應用程式的方式部署,改善效能調整方面的考量。
使用者介面組織架構運用 Portal Server 提供的基礎架構,提供國際化支援和安全。
Portal Server 提供一套自訂標示和資源組,可將入口網站組織架構顯示的內容加以區域化 - 主題和面板。 Portlet 的內容是透過一套資源組來進行區域化,此資源組提供標籤、按鈕及顯示訊息的內容。 從 Product Center 挑選的內容,將根據該應用程式層次可用的語言環境支援完成區域化。
入口網站使用者介面組織架構和 Product Center 使用 LDAP 作為存放使用者登錄的工具。 Product Center 和使用者介面組織架構各有一組不同的綱目來存放使用者資訊。 主要是因為在入口網站層次上登錄的使用者,以該層次執行供應商或廠商入口網站交談作業。 反之,向 Product Center 登錄的使用者,主要是系統的進階使用者或管理使用者。 使用者登錄方面的下一步是整合組織架構和 Product Center 使用綱目。 這在最後會形成通用使用者登錄,也將涉及使用者和角色的定義。
使用者的鑑別
在供應商入口網站實務中,供應商和一般使用者會利用入口網站進行註冊,並透過入口網站登入。 使用者管理和後續的使用者身份鑑別,皆於入口網站的 LDAP 層次上執行。 入口網站和底部 Product Center 層分享的重要資訊片段是供應商識別資訊。 此資訊用來過濾使用者已建立或使用的資料。
使用者的授權
根據登入的使用者來授權資料是 Product Center 的主要功能。 在系統的現行狀態,授權主要是供應商識別資料的過濾。 入口網站提供某種程度的 Portal Access 授權,是否允許使用者檢視和執行動作,視使用者是管理使用者或一般使用者而定。
本文說明 Product Center 的入口網站整合組織架構。
下列各節詳細說明在組織中部署「供應商入口網站」所需的環境設定。
本章假設 WebSphere Product Center 環境中安裝下列軟體:
選擇使用的作業系統將決定要安裝的軟體組合。執行「供應商入口網站」的基礎平台是 Portal Server 5.0.2.2 版。
安裝 Websphere Product Center 的入口網站整合包含兩個壓縮檔。 一個部署在 Portal Server,另一個部署在 Portal 整合的 Product Center 伺服器。
設定供應商入口網站的第一步包含配置 Portal Server for LDAP 的安全。此步驟假設已安裝下列軟體: IBM DB2、Directory Server 及 Directory Server 管理工具。
此步驟配置 LDAP 的 DB2 實例。
1. 瀏覽至開始 -> 程式集 -> IBM Tivoli Directory Server -> 目錄配置,開啟「Directory Server 配置工具」。
2. 在配置工具的左窗格,選取管理者 DN/密碼。
3. 輸入下列欄位值:
4. 按一下確定。
5. 在配置工具的左窗格,選取配置資料庫。
6. 選取建立新資料庫選項,按下一步。
7. 輸入 DB2 管理使用者的使用者 ID 和密碼(通常是 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" with "dc=wps,dc=com" 的所有項目。
5. 針對您的環境,適當地在 "LDAP Properties Configuration" 區段編輯下列內容:
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(IP Address of the LDAP Host machine)
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 上執行,則輸入指令時,您必須指定使用者 ID 和密碼進行安全鑑別:
(d) stopServer server1 -user was_admin_userid -password was_admin_password
(e) startServer server1
(f) startServer WebSphere_Portal附註:InfoCenter 中有幾項步驟,視安裝類型和作業環境而定。依照需求而定,可以排除這些步驟。
此步驟建立具有管理專用權的入口網站使用者。
1. 登入 Directory Server Web 管理工具。
2. 選取綱目管理 > 新增屬性,並新增下列屬性:
WPCRole{Syntax - Directory String Syntax, Attribute Length - 50}
userStatus{Syntax - Boolean}
userGLN{Syntax - Directory String Syntax, Attribute Length - 50}
company{Syntax - Directory String Syntax, Attribute Length - 50}
3. 選取綱目管理 > 新增物件類別,並新增下列類別:
物件類別:wpcUserClass
必要屬性 - abstract、company、UserStatus、WPCRole
選用屬性 - userGLN
4. 儲存所有變更。
5. 從配置工具匯入 portalAdmin.ldif 檔案。已附上管理 LDIF 範例檔作為參考。
6. 使用 admin/admin/ibm 登入 Portal
入口網站提供 Product Center 的介面,要求使用者登入入口網站時,必須輸入使用者 ID、密碼及公司資訊。 這需要修改 Portal Server 提供的標準登入頁面。
1. 自訂登入頁面之前,必須為「供應商入口網站」配置具有管理專用權的使用者。
(a) 使用入口網站管理者的使用者 ID 和密碼登入。
(b) 在頂端工具列按一下「管理」鏈結,在左窗格選取存取 > 使用者和群組。
(c) 在顯示的「群組」中,選擇 wpsadmins。
(d) 新增在 portalAdmin.ldif 中建立的使用者 "admin",儲存變更。如此,"admin" 使用者將具有供應商入口網站的管理專用權。
2. 當入口網站使用者登入或登出入口網站時,WP 會執行特定的登入/登出指令。 這些指令的類別名稱是在 PortalServer_root>/shared/app/config/services/ConfigService.properties 內容檔中指定, 預設值是:command.login = LoginUserAuth and 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" 欄位,並註銷「取消」按鈕程式碼片段(因為不需要)。
<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 = 使用者是 InActive,請與系統管理者聯絡。
(b) login.invalid.company = 使用者不屬於這個公司,請確認。
(c) ldap.not.configured = LDAP 鑑別服務失敗。請與系統管理者聯絡
請利用下列步驟,適當地配置 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. ftpDir(在 Portal_Config)應該在 FTP 伺服器的根目錄下。
6. 將 /public_html/WEB-INF/server-config.wsdd 位置的檔案設定為可寫入。
7. 先匯入 PORTAL_LKP.ZIP
8. 再匯入 PORTAL_NON_LKP.ZIP
9. 完成上述步驟之後,請記得重新啟動伺服器
10. 若為 Web Logic,在變更下列區塊之後,請記得儲存 Web 服務:
<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 端服務 Portlet 要求所需的 Product Center Script。 撰寫這些 Script 並製作成 Web 服務的細節已超出本章的討論範圍。
下列各節說明基礎組織架構和使用此架構的 Portlet。基礎架構包含資料交換的 XML 格式和代表此 XML 的資料物件。 這也需要在 XML 和 Java 之間相互執行轉換的類別。Product Center 調節器需要附加一組方法供 Portlet 使用。
在 Product Center 中,項目位於 Product Center 型錄之下。這些項目由「項目規格」來描述。 此規格是一組屬性。項目進一步分為種類和子種類。代表種類的這種樹狀結構也稱為階層。
WorkWithItem Portlet 協助使用者處理項目,且需要執行下列作業:
(a) 檢視項目
(b) 建立項目
(c) 修改項目
(d) 複製項目
(e) 刪除項目
WorkwithItem Portlet 的基本功能是檢視、建立、修改、複製及刪除型錄中的項目。 對於這些動作,Portlet 需要透過 Web 服務,以 XML 格式與 Product Center 交換資料。 亦即,對於 Portlet 中執行的每一個動作,XML 格式的要求會送往 Product Center,經過處理之後,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 服務 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 中,具有一組屬性的 "CatalogItem" 類別包含 Product Center 項目。
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 內容,並放入型錄項目 (Catalog Item) 資料物件中。
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 服務呼叫相關作業。 Portlet 代表功能需求和使用者互動相關作業。在 WorkwithItemPortlet 範例中,Portlet 需要:
(a) 檢視項目
(b) 建立項目
(c) 修改項目
(d) 複製項目
(e) 刪除項目
因此,調節器層應該增加方法,且這些方法應該執行下列動作:
(1) 載入適當的 SOAP URL 供執行 Web 服務呼叫。
(2) 建立該方法呼叫的要求 XML。
(3) 呼叫 SOAP URL 來起始 SYNC/ASYNC 呼叫。
(4) 接收回應 XML 並解譯。
(5) 如果順利完成,在適當的「資料物件」中轉換回應 XML。
(6) 如果未順利完成,以通知 (Notification) Bean 的格式將失敗資訊傳遞至 Portlet。應該擲出 WPCMediator 異常狀況。
例如,在調節器中提取 CatalogItem 的方法類似如下:
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. 開啟 Directory Server Web 管理工具,位置是 URL http://localhost:9080/IDSWebApp/IDSjsp/Login.jsp,並使用下列認證登入:
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 安裝光碟也包含這些檔案。
6. 將 customlogin.jar 和 ibmjndi.jar 新增至 <PortalServer_Root>\shared\app 資料夾。
7. 在命令提示字元,移至 "DirectoryServer_Root\appsrv\bin",並執行下列指令啟動 LDAP 伺服器:
startServer server1 -username wpsbind -password wpsbind
8. 開啟 Directory Server Web 管理工具,位置是 URL http://localhost:9080/IDSWebApp/IDSjsp/Login.jsp,並使用下列認證登入:
LDAP 主機名稱:localhost
使用者名稱:cn=root
密碼:password
9. 啟動 Web 管理工具。
10. 在命令提示字元,移至 "AppServer_Root\bin",並執行下列指令啟動 Portal Server:
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. 以管理者身分登入 Portal Server。
4. 按一下右上方的管理者鏈結。
5. 移至入口網站使用者介面 -> 主題和面板。
6. 按一下新增主題鏈結。
7. 輸入新主題的名稱和目錄為 "WPC_Default_theme"。按一下確定。
8. 按一下新增面板鏈結。
9. 輸入新面板的名稱和目錄為 "WPC_Default_skin"。按一下確定。
將 Portlet 組織在不同標籤下,如下所示:
首頁標籤 |
|
搜尋標籤 |
|
建立/編輯項目標籤 |
|
集體編輯標籤 |
|
上傳標籤 |
|
註冊標籤 |
|
遵循下列步驟來新增標籤的 Portlet。
1. 以管理者身分登入 Portal Server。
2. 按一下右上方的管理者鏈結。
3. 移至入口網站使用者介面 > 管理頁面。
4. 在畫面右方,對所需的頁面選取編輯頁面佈置按鈕。
5. 搜尋必要的 Portlet 並新增至頁面。
6. 對以上提及的所有標籤,重複步驟 (4) 和 (5)。
1. 以管理者身分登入 Portal Server。
2. 按一下右上方的管理者鏈結。
3. 移至存取 -> 資源許可權。
4. 對我的入口網站鏈結選取指派存取按鈕; 在編輯角色畫面提供所有已鑑別的使用者存取,按一下確定。
5. 同樣地,對「註冊頁面」提供匿名使用者存取,如步驟 (4) 所述,
1. 在下列配置檔,完成與「登出」有關的變更。
<PortalServer_Root>/shared/app/config/services/ConfigService.properties
# Logout redirect parameters
redirect.logout = true
redirect.logout.url = /wps/myportal
經過上述變更,當按下 "Logout" 鏈結時,入口網站會重新導向「登入」頁面。
2. 在下列配置檔,完成與「登出」有關的變更。
<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. 從登入頁面,按一下「註冊」鏈結。
b. 畫面上會顯示「使用者註冊」Portlet
c.「使用者註冊」Portlet 會顯示供應商 GLN 和電子郵件位址。由使用者輸入此資訊。
d. 按「下一步」按鈕,驗證 GLN 和電子郵件位址
e. 經過系統辨識之後,接著會顯示密碼欄位。
f. 系統會檢查確定密碼相同。
g. 顯示通知畫面,表示註冊核准資訊將傳送給使用者,之後使用者就可以登入入口網站。
使用者註冊核准 - 手動
a. 此為離線程序。WebSphere Product Center 管理者必須核准已註冊的使用者。 如此會允許使用者登入入口網站,並使用 WebSphere Product Center 相關的 Portlet。
b. WebSphere Product Center 管理者必須指派角色給已註冊的使用者。 此動作必須在 Portal Server 和 WebSphere Product Center 共用的 LDAP 儲存庫手動執行。 這樣可以確保使用者獲得授權執行 WebSphere Product Center 相關的交易。
檢視項目型錄
a. 此 Portlet 以樹狀結構格式列出項目型錄。項目是此型錄樹狀結構的葉節點。
b. 使用者選取型錄,也可以選擇新增項目。此選項是動作按鈕區的一個按鈕。
c. 使用者選取項目,也可以選擇檢視、編輯、複製或刪除項目。這些選項是動作按鈕區的按鈕。
d. 這些按鈕僅適用於項目上的作業。
e. 從 WebSphere Product Center 擷取第一層型錄。根據使用者互動情形,擷取子節點(子型錄和項目); 使用者展開節點之後,畫面上才會顯示節點之下的內容。這樣可以減少隨時需要載入的資料量,但會增加呼叫 WebSphere Product Center 來擷取此資訊的次數。
檢視現有的項目
a. 從「項目型錄」Portlet 選取項目,按一下「檢視項目」按鈕。「使用項目」Portlet 會呈現項目詳細資料。內容會以唯讀模式顯示。
新增新項目
a. 從「項目型錄」Portlet 選取型錄,按一下「新增項目」按鈕。「使用項目」Portlet 會呈現項目內容,所以使用者可以輸入項目資訊。 「新增」作業會在選取的型錄之下新增已輸入的項目。
b. 在「使用項目」Portlet 中按一下「新增項目」按鈕,一樣可以起始此項目建立程序。但這樣會在未指派的型錄之下建立項目。
c. 送出時會執行輸入項目相關的驗證。第一層驗證是根據從 WebSphere Product Center 接收的屬性 Meta 資訊來執行。 這些驗證通常包括類型檢查和範圍檢查。JavaScript 層次檢查不執行這些驗證。
d. 使用者也可以選擇取消作業。Portlet 將回到起始狀態。
更新現有的項目
a. 從「項目型錄」Portlet 選取項目,按一下「更新項目」按鈕。「使用項目」Portlet 會呈現項目內容,所以使用者可以輸入項目更新資訊。
b. 搜尋並選取項目,然後在搜尋結果中按一下「使用項目」按鈕,一樣可以起始此項目更新程序。「使用項目」Portlet 中會填入項目資訊。接著,使用者可以按一下「更新項目」按鈕,開始使用此項目。
c. 從「項目型錄」Portlet 選取項目,並按一下「檢視項目」,一樣可以起始此項目更新程序。「使用項目」Portlet 中會填入資料。接著,使用者可以按一下「更新」按鈕。內容會以可編輯的模式呈現。
d. 送出時會執行輸入項目相關的驗證。第一層驗證是根據從 WebSphere Product Center 接收的屬性 Meta 資訊來執行。 這些驗證通常包括類型檢查和範圍檢查。JavaScript 層次檢查不執行這些驗證。
e. 使用者也可以選擇取消作業。Portlet 將回到起始狀態。
複製項目
a. 從「項目型錄」Portlet 選取項目,按一下「複製項目」按鈕。「使用項目」Portlet 會呈現項目內容的複本,所以使用者可以執行項目複製作業。
b. 搜尋並選取項目,然後在搜尋結果中按一下「使用項目」按鈕,一樣可以起始此項目複製程序。「使用項目」Portlet 中會填入項目資訊。使用者可以按一下「複製」按鈕,並使用此項目。
c. 從「項目型錄」Portlet 選取項目,並按一下「檢視項目」,一樣可以起始此項目複製程序。「使用項目」Portlet 中會填入資料。接著,使用者可以按一下「複製」按鈕。內容會以可編輯的模式呈現。
d. 送出時會執行輸入項目相關的驗證。第一層驗證是根據從 WebSphere Product Center 接收的屬性 Meta 資訊來執行。 這些驗證通常包括類型檢查和範圍檢查。JavaScript 層次檢查不執行這些驗證。
e. 使用者也可以選擇取消作業。Portlet 將回到起始狀態。
移除現有的項目
a. 從「項目型錄」Portlet 選取項目,按一下「刪除項目」按鈕。「使用項目」Portlet 會呈現項目內容,所以使用者可以執行項目刪除作業。項目內容會以可讀取的模式呈現。
b. 搜尋並選取項目,然後在搜尋結果中按一下「使用項目」按鈕,一樣可以起始此項目刪除程序。「使用項目」Portlet 中會填入項目資訊。使用者可以接著按一下「刪除」按鈕,刪除此項目。
c. 從「項目型錄」Portlet 選取項目,並按一下「檢視項目」,一樣可以起始此項目刪除程序。「使用項目」Portlet 中會填入資料。接著,使用者可以按一下「刪除」按鈕。
d. 使用者也可以選擇取消作業。Portlet 將回到起始狀態。
項目搜尋
a. 搜尋 Portlet 一開始會顯示搜尋準則值:GTIN、GLN、目標市場、產品狀態(核准、拒絕、初稿等)、SKU#、價格、傳回單一項目或階層。使用者可以執行萬用字元搜尋。
b.「搜尋準則」為「日期」或「數字」類型的準則提供範圍選項。例如,「價格」準則可以大於 $100 且小於 $500。
c.「搜尋準則」會儲存使用者的最後 10 個搜尋準則,並列出這些準則。按一下此鏈結會使用這些準則執行搜尋。
d. 搜尋結果會在相同 Portlet 中顯示於搜尋準則下方。傳回的搜尋結果依使用者指定的捲動大小顯示。此值可以透過 Portlet 的編輯選項來設定。 搜尋結果大小由 WebSphere Product Center 控制,通常以搜尋效能為主要考量。搜尋結果的顯示由 Portlet 控制,通常以使用者感覺為主要考量。
e. 使用者可以從搜尋結果中選取單一項目,並按一下「使用項目」按鈕。項目資訊會移至「使用項目」Portlet。
f. 使用者可以從搜尋結果中選取多重項目,並按一下「使用項目」按鈕。項目會移至「項目集體更新」Portlet。
集體上傳
a.「集體上傳」Portlet 提供檔案瀏覽器介面,可以從使用者的機器上,將逗點分隔值 (CSV) 檔案上傳至 WebSphere Product Center。
b. 以 WebSphere Product Center 而言,此為一項冗長的交易,所以是非同步交易。CSV 檔案會上傳至 WebSphere Product Center,交易結果會經由入口網站的訊息或透過電子郵件,向使用者報告。
大量 / 集體更新
a. 使用者利用「搜尋」Portlet 來搜尋項目。然後選取搜尋結果顯示的項目,並按一下「使用項目」按鈕。
b. 所選取項目的內容會轉送至「項目集體更新」Portlet。現在,使用者可以對選取的屬性集執行項目集體更新。
在訊息格式方面,我們選擇與 UCCNet 相似的訊息格式。 封套具有標頭和主體。標頭包含用來識別傳送端 / 接收端詳細資料的資訊及唯一的訊息 ID。 若為要求訊息,主體包含要執行的指令和相關資訊;若為回應訊息,則具有回應詳細資料。
Portal 和 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 要求文件並確認給定的文件有效且格式正確之後,交易 ID 將送回呼叫端。 之後,呼叫端可能會依據交易 ID,隨時輪詢所要求的交易狀態。
為了在 Product Center 中新增型錄項目,入口網站必須傳送下列訊息 Skeleton,並填寫適當的資料。 若要立即取得回應,模式旗標應該設為 "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 要求,wpcResponse 會在回應中加入 wpcCatalogueItem 區塊,這在 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=”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 要求之後立即傳送的回應相同
本節說明入口網站整合相關的 Script 和 Web 服務。
wpc_portal_integrated_dev
Web 服務實作 Script (/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 訊息和呼叫給定指令的個別 Script。
給定的要求會新增項目並傳回成功或失敗回應。
//
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 服務組織架構本身來處理,不是以個別的 Script 實作方式來處理。 Web 服務組織架構會提供唯一的交易 ID 給每一個 ASYNC 要求。 當 WPS 傳送具有給定的交易 ID 的查詢交易詳細訊息時,組織架構會負責傳送實作 Script 時所產生的回應。
//
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>
此為輪詢訊息,由使用者定期傳送,瞭解給定的交易 ID(ASYNC 訊息)是否已完成。 此訊息也將由 Web 服務組織架構處理,不是以實作方式 Script 來處理
//
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 服務附件傳送的檔案,回應實作方式 Script 會將上傳的檔案複製到文件儲存庫中個別的 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 檔案, 接著,傳送匯入訊息連同上傳檔案的文件儲存庫路徑,同樣的資訊將由實作方式 Script 處理來新增或更新個別的記錄。
//
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 隨時會改進和/或變更本出版品所提及的產品和/或程式,不另行通知。
這份資訊中所提及的任何非 IBM 網站只供參考,IBM 不為這些網站提供保證。 這些網站所提供的素材不是 IBM 本產品的素材內容,如果要使用這些網站的素材,您必須自行承擔風險。
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 標誌
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 包含適用於下列附加條款的「排除元件」(依照相關的授權資訊文件所定義)。
本軟體是依照國際程式授權合約的條款,遵循其「排除元件」規定而授權給 貴客戶。
IBM 必須向 貴客戶提供與本軟體相關的下列注意事項:
i.) IBM WebSphere Product Center 包括 IBM 依照 Apache 2.0 授權合約條款,自 Apache Software Foundation 獲得授權的下列軟體:
- 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 包括 IBM 依照下列條款,自 Scott Hudson、Frank Flannery 和 C. Scott Ananian 獲得授權的下列軟體:
- 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 包括 IBM 依照下列條款,自 Elliot Joel Berk 和 C. Scott Ananian 獲得授權的下列軟體:
- 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 包括 IBM 依照下列條款,自 International Business Machines Corporation 和其他公司獲得授權的下列軟體:
- 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.
本軟體僅 "依現狀" 提供,不含任何明示或默示之保證,包括且不限於可商用性、特定目的之適用性及無侵權之保證。不論在何種情況之下,包括契約責任、過失責任或其他侵權行為責任,著作權持有人或本聲明所包含的著作權人均不為使用或執行本軟體時所產生或相關之任何索賠,或任何間接或衍生之損害,或任何為了無法使用、資料毀損或所失利益而負責。
除非本聲明有所規定,否則,在未取得著作權人書面授權之前,不得利用著作權人姓名做廣告,或以其他方式對本軟體之銷售、使用或其他商業往來做促銷。
-----------------------------------------------------------------------------
此處所指之所有商標和註冊商標均分別為其擁有者的資產。