/*

*LicensedtotheApacheSoftwareFoundation(ASF)underoneormore

*contributorlicenseagreements.SeetheNOTICEfiledistributedwith

*thisworkforadditionalinformationregardingcopyrightownership.

*TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0

*(the"License");youmaynotusethisfileexceptincompliancewith

*theLicense.YoumayobtainacopyoftheLicenseat

*

*http://www.apache.org/licenses/LICENSE-2.0

*

*Unlessrequiredbyapplicablelaworagreedtoinwriting,software

*distributedundertheLicenseisdistributedonan"ASIS"BASIS,

*WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.

*SeetheLicenseforthespecificlanguagegoverningpermissionsand

*limitationsundertheLicense.

*/




#include<axis2_handler_desc.h>

#include<axutil_array_list.h>

#include<axiom_soap_const.h>

#include<axiom_soap_envelope.h>

#include<axiom_soap_header.h>

#include<axiom_soap_header_block.h>

#include<axis2_op.h>

#include<axis2_msg_ctx.h>

#include<axis2_conf_ctx.h>

#include<axis2_msg_info_headers.h>

#include<axutil_property.h>



axis2_status_tAXIS2_CALL

axutil_log_in_handler_invoke(structaxis2_handler*handler,

constaxutil_env_t*env,

structaxis2_msg_ctx*msg_ctx);



AXIS2_EXTERNaxis2_handler_t*AXIS2_CALL

axutil_log_in_handler_create(constaxutil_env_t*env,

axutil_string_t*name)

{

axis2_handler_t*handler=NULL;



AXIS2_ENV_CHECK(env,NULL);



handler=axis2_handler_create(env);

if(!handler)

{

returnNULL;

}



axis2_handler_set_invoke(handler,env,axutil_log_in_handler_invoke);



returnhandler;

}





axis2_status_tAXIS2_CALL

axutil_log_in_handler_invoke(structaxis2_handler*handler,

constaxutil_env_t*env,

structaxis2_msg_ctx*msg_ctx)

{

axiom_soap_envelope_t*soap_envelope=NULL;

axiom_node_t*ret_node=NULL;



AXIS2_ENV_CHECK(env,AXIS2_FAILURE);

AXIS2_PARAM_CHECK(env->error,msg_ctx,AXIS2_FAILURE);



AXIS2_LOG_INFO(env->log,"Startinglogginginhandler.........");



soap_envelope=axis2_msg_ctx_get_soap_envelope(msg_ctx,env);



if(soap_envelope)

{

/*ensureSOAPbuiderstateisinsync*/

axiom_soap_envelope_get_body(soap_envelope,env);

ret_node=axiom_soap_envelope_get_base_node(soap_envelope,env);



if(ret_node)

{

axis2_char_t*om_str=NULL;

om_str=axiom_node_to_string(ret_node,env);

if(om_str)

{

AXIS2_LOG_INFO(env->log,"Inputmessage:%s",om_str);

}

}

}



returnAXIS2_SUCCESS;

}