NonStop SOAP 4.1 User's Manual

logging_out_handler.c
is the C stub file where you must implement the loggingOutHandler business logic for
the handler. For the logging module, the business logic is designed to log the output
XML message.
Makefile
is the Makefile for the logging module.
NOTE: If the specified directory is not created with all the listed files, repeat Step 1 through
Step 3. Do not attempt to manually create the directory structure or the files in it.
Implementing the Business Logic in the Module Handler Stub Files
After generating the module handler stub files using the SoapAdminCL tool, you must implement
the business logic in the invoke methods as described in:
“Implementing the invoke() Method for loggingInHandler (page 134)
“Implementing the invoke() Method for loggingOutHandler (page 134)
Implementing the invoke() Method for loggingInHandler
Each handler in a module has an invoke() method associated with it. The application logic of
the handler must be coded in this method:
axis2_status_t AXIS2_CALL axutil_logging_in_handler_invoke
(axis2_handler_t *handler,
const axis2_env_t *env,
struct axis2_msg_ctx *msg_ctx);
where,
axis2_handler_t *handler
is the address of a handler object.
const axis2_env_t *env
is the address of an environment structure.
struct axis2_msg_ctx *msg_ctx
is the address of a message context structure. The message context structure includes information
about the XML message and the message context structure.
Implement the following business logic for the logging module:
1. Get the SOAP envelope from the message context structure.
2. Get the SOAP message body from the SOAP envelope.
3. Get the root node of the SOAP body.
4. Get the XML message by serializing the root node.
5. Log the XML message to the log file.
For the sample source code for invoke() method of loggingInHandler, see the <NonStop
SOAP 4 Installation Directory
>/sample_services/modules/mod_logging/src/logging_in_handler.c file.
Implementing the invoke() Method for loggingOutHandler
Each handler in a module has an invoke() method associated with it. The application logic of
the handler must be coded in this method:
axis2_status_t AXIS2_CALL axutil_logging_out_handler_invoke(
struct axis2_handler * handler,
const axutil_env_t * env,
struct axis2_msg_ctx * msg_ctx)
134 Customizing NonStop SOAP 4 Message Processing