Using WebSphere Registry and Repository inside an WebSphere Message Broker Flow
Step 1: Build an Message Broker flow that looks like the following:
Step 2: Configure WSRR_IN and specify an MQ Queue
Step 3: Configure the Endpoint Lookup One Node to the following
The customer WSDL is loaded into WSRR below with namespace http://jkhle.itso.ibm.com
Step 4: SOAP Request Node looks like the following:
Step 5: The InformWSResult contains the following ESQL code to notify that the WSRR lookup was successful.
CREATE COMPUTE MODULE WSRR_Connectivity_InformWSResult
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
— CALL CopyEntireMessage();
CALL CopyMessageHeaders();
— The response from the WebService contains a HTTP Header
— Remove the HTTP header and create a MQMD header in order to propagate the message to a MQ output node
SET OutputRoot.HTTPResponseHeader = NULL;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN ‘MQMD’;
— Retrieve the MQMD that was stored earlier
SET OutputRoot.MQMD = Environment.MQMD;
SET OutputRoot.XMLNSC = InputRoot.SOAP.Body;
RETURN TRUE;
END;
Alternatively Step 5: If failure occurred during WSRR call the following Message will be shown:
“Failure to retrieve Service from WSRR”
CREATE COMPUTE MODULE WSRR_Connectivity_InformFailure
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
CREATE LASTCHILD OF OutputRoot DOMAIN ‘XMLNSC’;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version = ‘1.0’;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = ‘UTF-8’;
CREATE LASTCHILD OF OutputRoot.XMLNSC NAME ‘LookupResults’;
SET OutputRoot.XMLNSC.LookupResults.WSRR_Request = InputRoot.XMLNSC.WSRR_Request;
SET OutputRoot.XMLNSC.LookupResults.ServiceRegistry = ‘Failure to retrieve Service from WSRR!’;
SET OutputRoot.XMLNSC.LookupResults.Exception = InputExceptionList;
RETURN TRUE;
END;
Alternative Step 5: No matching Service Exist in WSRR the following error will occur: “No match services!”
CREATE COMPUTE MODULE WSRR_Connectivity_InformNoMatch
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
CREATE LASTCHILD OF OutputRoot DOMAIN ‘XMLNSC’;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version = ‘1.0’;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = ‘UTF-8’;
CREATE LASTCHILD OF OutputRoot.XMLNSC NAME ‘LookupResults’;
SET OutputRoot.XMLNSC.LookupResults.WSRR_Request = InputRoot.XMLNSC.WSRR_Request;
SET OutputRoot.XMLNSC.LookupResults.ServiceRegistry = ‘No matching services!’;
RETURN TRUE;
END;