PeopleSoft Allows user to handle exceptions using the Peoplecode. When there are exceptions arises during sending messages the following code can be deployed to exactly capture the error associated with exception and write to an error report.
LogoutRespMSG = %IntBroker.SyncRequest(&LogoutMSG);
If &LogoutRespMSG.ResponseStatus <> %IB_Status_Success Then
MessageBox(0, "", 0, 0, "Trouble Calling Logout API.please Check integration logs");
&nMsgNumber = &LogoutRespMSG.IBException.MessageNumber;
&nMsgSetNumber = &LogoutRespMSG.IBException.MessageSetNumber;
&exceptString = &LogoutRespMSG.IBException.ToString();
&UpdxmldocReturn = &LogoutRespMSG.GetXmlDoc();
MessageBox(0, "", 0, 0, "&exceptString" | &exceptString);
&logoutxmldocReturn = &LogoutRespMSG.GetXmlDoc();
&exceptionCode = &logoutxmldocReturn.DocumentElement.GetElementsByTagName("exceptionCode").Get(1).NodeValue;
&exceptionMessage = &logoutxmldocReturn.DocumentElement.GetElementsByTagName(":exceptionMessage").Get(1).NodeValue;
MessageBox(0, "", 0, 0, " Logout API exceptionCode:" | &exceptionCode);
MessageBox(0, "", 0, 0, "Logout API exceptionMessage:" | &exceptionMessage);
End-If;
This code works when the user exception check box checked at the Service Operation routing definition page. Without this checkbox checked, peoplesoft will fail the integration and logs a generic message.

No comments:
Post a Comment