HTTP processing user exit class
When you send outbound transactions to an external system by using HTTP, you can use an HTTP exit placeholder for customization. This exit class is optional and is called as part of the response from the HTTP call.
The HTTP processing exit class runs when a response is returned to an HTTP Post from an external system. In the default implementation of the psdi.iface.router.DefaultHTTPExit class, the response code that is received from the external system is compared to a range of response codes. The range that is used by the default implementation is 200 - 299. If the code is outside that range, then the transaction was not delivered to the external system, and an exception is raised.
With some external systems, the response from an HTTP call is interpreted to see whether the external system accepted the message. The interpretation logic can be implemented in the HTTP exit class.
If the publish channel message is not accepted, the code must raise an exception. The message in the outbound queue is marked as an error and is not removed from the queue. If the message is accepted, the message is removed from the outbound queue. If the invocation channel message fails, the exception is returned to the invoker of the channel, and the invoker handles the exception according to the design requirements.
The HTTP processing exit class must implement the psdi.iface.router.HTTPExit interface and implement the following method:
public void processResponseData(int responseCode, String
responseMsg, byte[] msgBodyData)
If necessary, this class can interpret the response code and throw an exception. The class can perform the following actions:
- Check the response code from the HTTP post.
- If the response code is in the error range, the exception is logged on the ERROR level, and a system exception is thrown.
- If the response code is valid, the transaction is logged on the DEBUG level.
You must specify the fully qualified name of the Java™ class in the HTTPEXIT property of the endpoint that implements the HTTP handler.