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.
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.
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 following diagram shows 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.
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.
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:
The route is as described previously, but with the following differences:
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.