Install sandesha2 module into <axis2 deploy folder>/modules folder. Add the RMPhase information into axis2.xml as following. Search for 'RMPhase' in the following xml block to identify the RM specific entries.
<!-- ================================================= --> <!-- Phases --> <!-- ================================================= --> <phaseOrder type="inflow"> <!-- System pre defined phases --> <phase name="TransportIn"/> <phase name="PreDispatch"/> <phase name="Dispatch"> <handler name="AddressingBasedDispatcher" class="axis2_engine"> <order phase="Dispatch"/> </handler> <handler name="RequestURIBasedDispatcher" class="axis2_engine"> <order phase="Dispatch"/> </handler> <handler name="SOAPActionBasedDispatcher" class="axis2_engine"> <order phase="Dispatch"/> </handler> <handler name="SOAPMessageBodyBasedDispatcher" class="axis2_engine"> <order phase="Dispatch"/> </handler> </phase> <phase name="PostDispatch"> <handler name="DispatchPostConditionsEvaluator" class="axis2_engine"> <order phase="PostDispatch"/> </handler> <handler name="InstanceDispatcher" class="axis2_engine"> <order phase="PostDispatch"/> </handler> <handler name="SOAPProcessingModelChecker" class="axis2_engine"> <order phase="PostDispatch"/> </handler> </phase> <!-- System pre defined phases --> <!-- After Postdispatch phase module author or or service author can add any phase he want --> <!--phase name="userphase1"/--> <phase name="RMPhase"/> </phaseOrder> <phaseOrder type="outflow"> <!-- user can add his own phases to this area --> <phase name="RMPhase"/> <!--phase name="userphase1"/--> <!--system predefined phase--> <!--these phase will run irrespective of the service--> <!--phase name="PolicyDetermination"/--> <!--phase name="MessageOut"/--> </phaseOrder> <phaseOrder type="INfaultflow"> <!-- user can add his own phases to this area --> <!--phase name="userphase1"/--> <phase name="RMPhase"/> </phaseOrder> <phaseOrder type="Outfaultflow"> <!-- user can add his own phases to this area --> <phase name="RMPhase"/> <phase name="MessageOut"/> <!--phase name="userphase1"/--> <!--phase name="PolicyDetermination"/--> </phaseOrder>
In the services xml file for the service which require RM enabled add the entry <module ref="sandesha2"/> If you need all services in the engine RM enabled add the above entry into axis2.xml.
You can use samples in the samples folder for testing.
Please keep in mind the following when using Sandesha2/C with Axis2/C.
axutil_free_thread_env(thread_env);
axutil_thread_pool_exit_thread(env->thread_pool, thd);
property = axutil_property_create(env); axutil_property_set_scope(property, env, AXIS2_SCOPE_REQUEST); axutil_property_set_free_func(property, env, axis2_http_client_free_void_arg); axutil_property_set_value(property, env, sender->client); axis2_msg_ctx_set_property(msg_ctx, env, AXIS2_HTTP_CLIENT, property);