Running the Address Book sample

Running the Address Book sample consists of putting messages through the consumer message flow or calling the provider flow directly. Two Test Clients are provided for running the Address Book sample.

Before you run the sample, verify that your Web services consumer is configured correctly for the provider and that JNDI administered objects are configured to run JMS flows. See Setting up the Address Book sample to use HTTP and Setting up the Address Book sample to use JMS transport.

If you encounter any problems when you run the sample, see Resolving problems when running samples in the IBM Integration Bus documentation.

Verifying that the provider has the correct port for the consumer

Running the sample

How to call the consumer flow, which in turn calls the provider flow:

  1. In the Application Development view, expand the AddressBook project.
  2. Expand Flow Tests. Double-click AddressBookTests.mbtest to open the file in the Test Client.
  3. Select the first Enqueue. Click Send Message.
  4. If you have not enabled the TCP/IP Monitor you can skip this step. Otherwise, with the TCP/IP Monitor set up and started, the monitor is displayed and shows the SOAP message that has been transmitted between the provider and consumer flow.

    If the monitor is not displayed, you can add it to your workbench now: Click Window > Show View > Other > Debug > TCP/IP Monitor.

    Check the contents of the inbound and outbound SOAP messages. If you want to make the message easier to read, use the menu in the TCP/IP Monitor to change the format from Byte to XML.

  5. Select the first Dequeue. Click Get Message. You now see both the HTTP response from the SOAPRequest node and the XML message. The following response is displayed:
    <SOAP_Domain_Msg>
    <Body>
    <NS2:SaveAddressResponse xmlns:NS2="http://addressbook.com/">true<NS2:SaveAddressResponse>
    <Body>
    <SOAP_Domain_Msg>
    
  6. Select the second Enqueue and click Send Message.
  7. If you have not enabled the TCP/IP Monitor, you can skip this step. Otherwise, check the TCP/IP Monitor to ensure that the SOAP message has been transmitted.
  8. Select the second Dequeue and click Get Message. You now see the HTTP response from the SOAPRequest node and the XML message. You get the following response:
    <SOAP_Domain_Msg>
    <Body>
    <NS2:Address xmlns:NS2="http://addressbook.com/">
    <NS2:City>Carlisle</NS2:City>
    <NS2:Street>Welton</NS2:Street>
    <NS2:Province>Cumbria</NS2:Province>
    <NS2:PostalCode>NE2 3HP</NS2:PostalCode>
    <NS2:PhoneNumber>
    <NS2:Area>1</NS2:Area>
    <NS2:Prefix>2</NS2:Prefix>
    <NS2:Local>3</NS2:Local>
    </NS2:PhoneNumber>
    </NS2:Address>
    <Body>
    <SOAP_Domain_Msg>
    

To call the provider flow directly in the case of SOAP over HTTP:

  1. In the Application Development view, expand the AddressBook project.
  2. Expand Flow Tests. Double-click AddressBookProviderTest.mbtest to open the file in the Test Client.
  3. Click Send Message.
  4. In the Deployment Location window, select the AddressSampleProvider execution group. Click Finish. The message flow is deployed to the selected execution group, and the test message is sent. You get the following output when the response is received:

    A diagram showing the content of the first message flow.

  5. Before calling the flow again, to look up the address that you just saved you must prevent the Test Client from redeploying the flow. Redeploying the flow destroys any data in the ESQL shared variable that is used by the address book. To prevent the Test Client from redeploying the flow, select the Configuration tab of the Test Client; select Deployment in the left pane. Select I will deploy the specified Broker Archive manually. Enter the name of the BAR file and save your changes. Go back to the Events tab.
  6. Select the second Invoke Message Flow and click Send Message. If required, select the AddressSampleProvider execution group. Click Finish.
  7. Compare the responses with the output from the consumer. You get the following output when the response is received:

    A diagram showing the content of the second message flow.

If you have finished with this sample and had previously enabled the TCP/IP Monitor and modified the flow, you must now remove the TCP/IP monitor and change the flow back.

  1. In the workbench, click Window > Preferences > Run/Debug > TCP/IP Monitor.
  2. Highlight your TCP/IP monitor and click Remove followed by OK.
  3. You updated the AddressBookConsumerFlow to interact with the TCP/IP Monitor so, depending on what you now want to do, you can choose to leave the modified flow alone or change it back. If you want to change it back, follow the same steps as before, but change the HTTP port from 5555 back to 7800 in both of the SOAPRequest nodes, and then rebuild and redeploy.

Back to sample home