Database Reference
In-Depth Information
We will simplify two default servlet operations, doGet and doPost , by calling the same
processRequest procedure that will be our entry point to the processing logic:
public void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
processRequest(request, response);
}
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
doGet(request, response);
}
First, we will make an instance of a request helper, a log handler, and two supporting ob-
jects, namely MessageHeader and Acknowledge :
protected void processRequest(HttpServletRequest
request, HttpServletResponse response)
throws ServletException, IOException {
...
MessageRequestHelper helper =
getMessageRequestHelper(request, response);
LogHandler logger = new LogHandler();
...
MessageHeader mheader = new MessageHeader();
Acknowledge ack = new Acknowledge();
The MessageHeader object will contain all message-context elements that we will ex-
tract from the inbound message. It is ideal that we will have a unified standard header
(which is not always true) within a single organization (CTU), but external partners/mo-
bile equipment suppliers use their own standards, which are not always compatible with
SDBH. Thus, we will have to modify the message header after identifying the trading
partner(s). Have a look at the following figure:
Search WWH ::




Custom Search