About the WebSphere Service Registry and Repository Connectivity sample

The WebSphere Service Registry and Repository (WSRR) Connectivity sample is based on a scenario where a business wants to use the WebSphere Service Registry and Repository to dynamically choose a Web service to be called at runtime. The sample demonstrates the use of the EndpointLookup node to retrieve WSDL files from the Service Registry to call a Web service, however, the Service Registry can also store other types of documents that can be retrieved by using the RegistryLookup node. Although the two nodes are used to retrieve different types of documents from the Service Registry, the configuration of both nodes is the same, and you can use the example configuration from this sample to use the RegistryLookup node.

The following diagram shows the architecture of using WebSphere Service Registry and Repository connectivity within a message flow.

An illustration of WebSphere Service Registry and Repository connectivity architecture.

The WebSphere Service Registry and Repository Connectivity sample demonstrates the following tasks:

The Web service in the sample, DemoCustomer services, accepts updateCustomer requests and returns updateCustomerResponse messages. A common requirement of an Enterprise Service Bus (ESB) and the Registry is to facilitate service invocation where two or more versions of the same service exist. The ESB must be able to call the appropriate service based on the request. The Registry must be able to accommodate multiple services such that they can be discovered and used. In this sample, two versions of DemoCustomer Web service exist, both implemented by using message flows that are running in IBM Integration Bus. Version 1.0 is called when the static EndpointLookup node properties are used, and version 2.0 is called when the input SOAP message contains runtime override information.

The messages

Three input messages are supplied for running the WebSphere Service Registry and Repository Connectivity sample:

The following message is the SOAP message that calls the Web service that is determined by the static EndpointLookup node properties (version 1.0):

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <Request>
      <Verb>UpdateCustomer</Verb>
      <Data>
        <Customer>ABC</Customer>
      </Data>
    </Request>
  </soapenv:Body>
</soapenv:Envelope>

The following message is the SOAP message that calls the Web service that is determined by the runtime overrides (version 2.0). The message is the same as the previous message, but with the addition of the Version tag, which is used at runtime to retrieve version 2.0 of the WSDL from the Service Registry:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 	xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <Request>
      <Version>2.0</Version>
      <Verb>UpdateCustomer</Verb>
      <Data>
        <Customer>ABC</Customer>
      </Data>
    </Request>
  </soapenv:Body>
</soapenv:Envelope>

The following message is the SOAP message with a Version property that does not match any documents in the Service Registry:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 	xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <Request>
      <Version>3.0</Version>
      <Verb>UpdateCustomer</Verb>
      <Data>
        <Customer>ABC</Customer>
      </Data>
    </Request>
  </soapenv:Body>
</soapenv:Envelope>

The message flows

The following diagram shows the main message flow.

A screen capture of the main message flow.

Node type Node name
MQInput WSRR_IN
MQOutput WSRR_OUT
Compute SetVersion, InformFailure, InformWSResult, InformNoMatch
EndpointLookup Endpoint Lookup One
SOAPRequest SOAP Request

The following diagram shows the Web service flow. Two versions of this Web service flow are shown. The difference between the two versions is the Compute node, which returns a different response to identify which version has been called.

A screen capture of the Web Service flow.

Node type Node name
SOAPInput SOAP DempCustomer
Compute Create WS Response
SOAPReply SOAP Reply

To find out more information about the nodes that are used in the WSSR Connectivity sample, see Built-in nodes in the IBM Integration Bus documentation.

The route taken by the first (static version) message

When you put the first message on to the input queue, the message passes through the nodes as described later in this topic. If any of the queues have been disabled, the message cannot follow this path.

The nodes in the main message flow have the following functions:

  1. WSRR.IN : The node gets the input message from the input queue.
  2. SetVersion : This Compute node overrides the Version property. Because there is no Version tag in this message, nothing is replaced in the local environment and therefore the static Version property in the EndpointLookup node is used to retrieve version 1.0 of the WSDL from the Service Registry.
  3. EndpointLookupOne: This node is the EndpointLookup node that connects to the Service Registry and retrieves the requested WSDL document (version 1.0 as defined in the EndpointLookup node configuration). The message is propagated to one of the three wired nodes as determined by the successful (or otherwise) retrieval of a matching WSDL document from the Service Registry. Because the EndpointLookup node is configured to retrieve only "One" matching WSDL document, there is no requirement to follow this node with a Compute node. If the EndpointLookup node is configured to retrieve "All" matching WSDL documents, follow this node with a Compute node to interrogate the retrieved documents. You can use the Compute node to select the document to send to the SOAPRequest node as shown in the preceding architecture figure.
  4. InformFailure : The message is propagated to this node if IBM Integration Bus encounters errors either connecting to, or while connected to the Service Registry.
  5. SOAPRequest : The message is propagated to this node if the EndpointLookup node successfully retrieved the requested WSDL document from the Service Registry. The node sends the SOAP message to the Web service that is determined by the endpoint in the WSDL.
  6. InformWSResult : Upon successful invocation of the Web service, this node converts the HTTP headers in the message to MQMD headers in order to propagate the response to the MQOutput node.
  7. InformNoMatch : The message is propagated to this node if the Service Registry cannot find a matching WSDL document.
  8. WSRR.OUT : This node puts the message on the WSRR.OUT output queue.
The nodes in the Web service flow have the following functions:
  1. SOAPDemoCustomerMB : This SOAPInput node receives the SOAP message from the main message flow.
  2. Compute : A response is generated by this node.
  3. SOAPReply : This node sends the response to the calling application, the SOAPRequest node.

The route taken by the second (runtime version) message

The route is as described previously, but with the following differences:

The route taken by the third (no match) message

The route is as described previously, but with the following differences:

The purpose of this sample is to read an input message, and to connect to the Service Registry to retrieve a WSDL document. If a match is found, it invokes the relevant Web service, and writes the message on another queue. If no match is found, it writes the "No match" message to the queue.

For more information, see WebSphere Service Registry and Repository in the IBM Integration Bus documentation.

Back to sample home