• No results found

Inbound flow

In document Implementing EDI Solutions by IBM (Page 110-115)

Chapter 2. Implementing iSoft P2PAgent

2.4 Integration with the Interchange Server

2.4.5 Inbound flow

The previous sections described in detail the integration process for the outbound flow. The steps of integrating the InterChange Server in the inbound flow are quite similar.

Business object

First, we need again a business object to represent the incoming purchase order. The DTD, listed in Example 2-15 on page 68, can be imported in the InterChange Server using the XML ODA as described in 2.4.1, “Creating business objects” on page 84.

Important: Since this business object will result in a message that is going to be

processed by WebSphere Data Interchange, you should provide data that makes sense for WebSphere Data Interchange. Setting a random value for TargetPartnerID will likely result in an unprocessed document within WebSphere Data Interchange.

Specify the following values for the PO DTD:

򐂰 Root element: PO 򐂰 Top Level element: PO 򐂰 BOPrefix: PO

The MQSeriesInbound connector

The next step is to create an additional MQSeries connector. Perform the following steps:

򐂰 Copy/paste the existing MQSeriesConnector object in the folder Connectors in the System Manager. Name it MQSeriesInboundConnector.

򐂰 Open a file browser and find the directory MQSeries in the connectors directory of the ICS installation. Copy the whole directory and name it MQSeriesInbound.

򐂰 Open the folder Connectors in the Start menu and copy/paste the existing short-cut MQSeries Connector as MQSeriesInbound Connector.

򐂰 Open the properties of this new short-cut and update the field Target:

D:\CrossWorlds\connectors\MQSeriesInbound\start_MQSeries.bat MQSeriesInbound cw_studenta -cD:\CrossWorlds\connectors\MQSeriesInbound\MQSeriesAgentConfig.cfg

MQSeries has been replaced three times with MQSeriesInbound. Update also the field Start in to the name of the new directory:

D:\CrossWorlds\connectors\MQSeriesInbound\

򐂰 Define a new queue AP/MQSERIESINBOUNDCONNECTOR/CW_STUDENTA on the queue manager used by the ICS. Replace CW_STUDENTA with the name of your ICS.

򐂰 Restart the ICS. After the restart, verify that the connector is running via the System Manager.

򐂰 Start the connector agent via the short-cut in the Programs folder and verify that the Agent State in the System Monitor is active.

Open the PortConnector object and update the supported business objects. Include business object PO_PO in the list and make sure to check the field Agent Support.

Create meta-objects

Once you have verified that the new connector can be started, proceed with the definition of meta-objects. Open the meta-object MO_DataHandler_WDIXML_Config and safe it as MO_DataHandler_CWXML_Config. Make the following changes:

򐂰 Provide the path to the location of the DTD and the file name

򐂰 Set the BOPrefix to PO

Define meta-object MO_CWXML_Config. You can copy the meta-object MO_WDIXML_Config. Rename the field POACK_POResponse to PO_PO. Define meta-object MO_DataHandler_Inbound_Default. You can copy it from MO_DataHandler_Default. For the MIME type text/xml, set the field type to

MO_DataHandler_CWXML_Config.

Open the connector object MQSeriesInboundConnector and switch to the tab Application Config Properties. Set the value of the property DataHandlerConfigMO to

MO_DataHandler_Inbound_Default. Set the value of the property ConfigurationMetaObject to

MO_CWXML_Config. Set the value of the property InputQueue to

queue://cw_studenta.queue.manager/purchase.orders. Save the changes and restart the connector.

Verify the map in WebSphere Data Interchange

The ICS requires that the incoming XML message contains a DOCTYPE statement, that includes the name of the DTD. To make sure that the XML document contains the DTD name, review the map 850TOXML in WebSphere Data Interchange. Open the map editor and verify if you have a SetProperty call for the property Diprolog, as shown in Figure 2-31.

Figure 2-31 Setting the property Diprolog

If this statement does not exist, right-click the name of the map 850TOXML and select

Insert -> Command -> SetProperty from the context menu. A mapping command editor

should appear, as shown in Figure 2-32. Update the template call of SetProperty to refer to the property Diprolog and set the value to what is required for your XML document.

Figure 2-32 Adding the name of the DTD to the XML document

Save and re-compile the map.

Create the collaboration

Expand the folder Collaboration Templates in the System Manager. Copy/paste the template CollaborationFoundation and name the new template WDI_Inbound_Template. Open the new template and open its definitions. Select the tab Ports and Triggering Events (see Figure 2-33 on page 99). Set the BOType to PO_PO for all three ports. Set the Create field for the From port to Main. Apply the changes. Compile and save the template.

Figure 2-33 Template definitions

Create now a new collaboration WDI_Inbound from the template WDI_Inbound_Template. Bind the ports as follows:

򐂰 From port: MQSeriesInboundConnector

򐂰 To port: PortConnector

򐂰 DestinationAppRetrieve port: PortConnector

Save and start the collaboration. Check the server log and verify that you see log messages as shown in Example 2-26.

Example 2-26 ICS log

[System: Server] [Thread: VBJ ThreadPool Worker (#5244814)] [Type: Info] [MsgID: 31] [Mesg: Initializing collaboration "WDI_Inbound".]

[System: Collaboration] [SS: WDI_Inbound] [Thread: VBJ ThreadPool Worker (#4968337)] [Type: Info] [MsgID: 11009] [Mesg: Subscribed to PO_PO.Create from publisher MQSeriesInboundConnector.]

[System: Collaboration] [SS: WDI_Inbound] [Thread: VBJ ThreadPool Worker (#4968337)] [Type: Info] [MsgID: 11014] [Mesg: Collaboration is active.]

Use the test connector

Finally, start the test connector and select the profile PortConnector. Connect to the server and create a business object of type PO_PO. Select the newly created business object and select Request -> Accept Request. The PortConnector acts now as an endpoint and is ready to receive PO_PO business objects.

Write now an EDI message on the queue INBOX, processed by WebSphere Data Interchange. The translated message, including a DOCTYPE, should then end on queue purchase.orders, which is monitored by the MQSeriesInbound Connector. The message will then be routed through the collaboration and end at the port connector in the test connector. Figure 2-34 on page 100 shows the test connector window when data has arrived.

Figure 2-34 A business object has arrived

Select the business object in the right pane to inspect the details. Figure 2-35 shows the business object representation of this XML message, which was a translation of an EDI 850 document.

In document Implementing EDI Solutions by IBM (Page 110-115)