IBM Support

Routing XML messages with different namespace prefixes

Question & Answer


Question

How do you get WebSphere Partner Gateway (WPG) 6.1 to route XML messages with different namespace prefixes?

Cause

When routing XML messages, you must setup an XML Format definition that contains the exact namespace and prefix defined in the XML message, as WPG 6.1 must be able to parse the inbound message for the Sender ID and Receiver ID in order to route the message. This document will explain how to configure three options in WPG to allow routing of XML messages when using different namespace prefixes.

Answer

Option 1: Create Document Family and XML Format for each message that will be using different namespace prefixes.

This option can only be used if you control the namespace prefixes being sent by the trading partner, as you must know and define a new XML Format for each prefix being used. If you have many XML namespace prefixes or do not control what prefixes can be sent to you by the trading partner, then option 2 or option 3 may be better choices.

Step 1). Create a Document Family using a Family Type of "NameSpace" and save the newly created document family



Step 2: Next create the XML Format under the newly created Document Family. Define the XML Format for the namespace and prefix to be used by the message as shown in the below screen shots and save the newly created XML Format for the defined namespace prefix.


Step 3). Repeat step 2 but creating a second "Document Family" using a Family Type of "NameSpace", however this time save the family name as something like "purchaseOrder01".


Step 4): Next create the XML Format under the newly created Document Family "purchaseOrder01". Define the XML Format for the namespace and second prefix to be used by the message as shown in the below screen shots and save the newly created XML Format for the defined namespace prefix.


Repeat Steps 3 and 4 as needed, using a different Document Family name for each XML Format being defined for each namespace prefix.

Option 2: Create one Document Family and XML Format for the local-name (Schema Root Tag ).

Step 1). Create a Document Family using a Family Type of "Root Tag" and save the newly created document family.



Step 2: Next create the XML Format under the newly created Document Family. When defining the XPath expression use the local-name ( Root Tag ) for the "format identifier", "source business identifier" and the "target business identifier" and save the newly created XML Format .




Step 3: Send the XML message which contains different XML prefix namespaces through WPG 6.1
Note: The local-name for the XML schema can also be used to define other fields in the XML Format such as the "Search Fields" as seen in the screen shot below.
Search Fields can also be defined with mapping commands using the DIS Client or through custom written User Exits. For more information on using DIS Client for defining custom Search Fields, see the document titled Configuring user defined Search Fields in WPG with Data Transformation Maps using the DIS Client.

Option 3: Create one Document Family and XML Format, using a combination of local-name and namespace.

Step 1). Create a Document Family using a Family Type of "NameSpace" and save the newly created document family


Step 2: Next create the XML Format under the newly created Document Family. Define the XML Format, using a combination of local name ( Root Tag) and namespace, as shown in the below screen shots. Save the newly created XML Format for the defined namespace prefix.




Step 3: Send the XML message which contains different XML prefix namespaces through WPG 6.1
Note: The combination of local-name and namespace for the XML schema can also be used to define other fields in the XML Format such as the "Search Fields" as seen in the screen shot below. Search Fields may also be defined with mapping commands using the DIS Client or through custom written User Exits. For more information on using DIS Client for defining custom Search Fields, see document 1293586.

[{"Product":{"code":"SSDKKW","label":"WebSphere Partner Gateway Advanced Edition"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"6.1;6.1.0.1;6.1.0.2;6.1.0.3;6.1.1;6.1.1.1;6.1.1.2;6.2;6.2.0.1;6.2.0.2;6.2.0.3;6.2.0.4;6.2.0.5;6.2.1;6.2.1.1","Edition":"All Editions","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
16 June 2018

UID

swg21293497