Monday, July 29, 2013

HTTP Test Service

I am working on integrating PeopleSoft HCM to Kenexa, a 3rd Party recruiting system, via IBM's DataPower ESB Component.  Since I have to translate the message in DataPower, I thought it might be useful to create a Test Service in IB that would generate a hard coded response using an HTML object and send me an email of the xml that is received.  This would allow me to test my response handling and see my XLST results coming out of DataPower.

The handler was pretty simple.

method OnRequest
   /+ &_MSG as Message +/
   /+ Returns Message +/
   /+ Extends/implements PS_PT:Integration:IRequestHandler.OnRequest +/
   /* Variable Declaration */
   Local Message &msgReply;
 
 
   Local XmlDoc &ResponseXML, &XML_MESSAGE;
 
 
   &msgReply = CreateMessage(Operation.ZZ_TEST_SERVICE, %IntBroker_Response);
 
 
   &XML_MESSAGE = &_MSG.GetXmlDoc();
 
   SendMail(0, "kevin.weaver@umb.com", "", "", "HCMSND", &XML_MESSAGE.GenXmlString());
   &ResponseXML = CreateXmlDoc(GetHTMLText(HTML.ZZ_TEST_SERVICE));
 
   &msgReply.SetXmlDoc(&ResponseXML);
 
 
   Return &msgReply;
 
end-method;

The problem I was having was Integration broker was not calling my handler and was responding back with this error.



<?xml version="1.0"?>
<IBResponse type="error"><DefaultTitle>Integration Broker Response</DefaultTitle><StatusCode>20</StatusCode><MessageSet>158</MessageSet><MessageID>10733</MessageID><DefaultMessage> Integration Gateway failed while processing the message. </DefaultMessage><MessageParameters><Parameter>NodeName: ZZ_ESB Is Not Default Local Node!!!</Parameter></MessageParameters></IBResponse>


So I went to my msgLog.html and discovered that Integration Broker was adding some HTTP Headers to the message.


Headers
NonRepudiation : [False]
TransactionID : [47956670-f86f-11e2-872e-a426c6fef051]
DataChunkCount : [1]
To : [ZZ_ESB]
Content-Type : [text/xml; charset=utf-8]
MessageType : [sync]
From : [PSFT_DEV]
MessageName : [ZZ_BR_SEND.v1]
DataChunk : [1]
version : [v1]

These Headers where impacting how the HttpListeningConnector was processing the message and preventing it from ever getting to my Handler.  Luckily, DataPower has the option to suppress headers and prevent them from being sent to their end point.  After, I suppressed these headers I was able to test my XLST and my logic to handle Kenexa responses.


 

No comments:

Post a Comment