588 WebSphere Business Integration Adapters
To create a new XML format:
1. While logged on as hubadmin, select Hub Admin Hub Configuration
XML Formats to open the Manage XML Formats window, as shown in
Figure 29-19.
Figure 29-19 Manage XML formats in WebSphere Business Integration Connect
2. Click Create XML Format. A new XML format form is presented. A new XML
format needs to be linked to an existing protocol, which is what you defined
earlier.
3. Select customXML 1.0 in the drop-down box that is labeled Routing Format.
The file type is XML.
4. Select Identifier Type as Root Tag. The root tag in our XML documents is
Maintenance. Other ways of identifying an XML document are by using a
DTD or name space.
5. In the section Schema Attributes, indicate to WebSphere Business
Integration Connect how to identify the source and target business identifiers.
These identifiers could be set as a constant, but in most cases, you use an
element in the XML document as the carrier for information about business
identifiers. That way, it becomes easier to send this kind of XML document to
multiple partners.
Chapter 29. Integrating external contractors using WebSphere BI Connect 589
Figure 29-20 shows a sample XML document that indicates the element
names that store business identifiers. Figure 29-21 on page 590 shows the
form for creating a new XML format.
Figure 29-20 Sample XML file (edited)
<?xml version="1.0" encoding="UTF-8"?>
<Q1:Maintenance xmlns:Q1="http://external.request.redmaint.com">
<Q1:From>redmaint</Q1:From>
<Q1:To>redcontract</Q1:To>
<Q1:ExpectedCompletion>1110600000000</Q1:ExpectedCompletion>
<Q1:ActualCompletion></Q1:ActualCompletion>
<Q1:StatusDescription></Q1:StatusDescription>
<Q1:Tenant>100</Q1:Tenant>
<Q1:Apartment>100</Q1:Apartment>
<Q1:MaintenanceId>2</Q1:MaintenanceId>
<Q1:CreateDate>1110500000000</Q1:CreateDate>
<Q1:Description>leak in roof</Q1:Description>
</Q1:Maintenance>
590 WebSphere Business Integration Adapters
Figure 29-21 Create a new XML format
6. Besides information about business identifiers, WebSphere Business
Integration Connect needs to know what document flow should be invoked for
XML documents of this format. This information could again be carried in the
XML document itself. However, we choose to make this information a
constant. The source document flow is ContractorRequest and the version is
1.0. The document flow was defined earlier, see Figure 29-17 on page 586.
7. Click Save to store the new format.
In our scenario, the ContractorResponse message is actually the same as the
ContractorRequest message. Only a few more elements are needed, but the root
element is the same. Also, the business identifiers are carried in the same
elements for the response as for the request. Therefore, you do not need to
define another document flow definition at the document flow level or to define
another XML format. However, in real-life situations, this is possible. We should
Chapter 29. Integrating external contractors using WebSphere BI Connect 591
then repeat the steps outlined above, so that a document flow definition and XML
format is created to handle ContractorResponse messages.
Creating interaction
Earlier, we created the protocol customXML that could be packaged in AS2,
None, or Backend Integration. We then created the document flow
ContractorRequest that was linked to the protocol customXML for each
packaging method. We defined the XML format linked to that document flow.
The next step is to create the interactions that tell WebSphere Business
Integration Connect how to move from one packaging, protocol, or document to
another. To create this interaction:
1. While logged on as hubadmin, select Hub Admin Hub Configuration
Document Flow Definition.
2. Click Manage Interactions. Then, click Create Interaction.
3. We need an interaction from AS/customXML/ContractorRequest to
None/customXML/ContractorRequest, which is the interaction shown in
Figure 29-22 on page 592. Select Pass Through as the action and click
Save.
592 WebSphere Business Integration Adapters
Figure 29-22 Creating interaction from packaging AS to None for customXML
4. Repeat steps 1 on page 591 through 3 on page 591 to create the reverse
interaction, from None/customXML/ContractorRequest to
AS/customXML/ContractorRequest. This interaction is shown in Figure 29-23
on page 593. Select Pass Through and click Save.

Get WebSphere Business Integration Adapters: An Adapter Development and WebSphere Business Integration Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.