yes I follow all the instructions.
I know that my modules are engaged ( I checked it) but the handler is not
executed!!
Actually, this is what I have done
1) This is a part of my client code:
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem("D:/eclipse_workspace/axis2",
"D:/eclipse_workspace/axis2/conf/axis2.xml");
//Non-Blocking Invocation
sender = new ServiceClient(configContext, null);
sender.setOptions(options);
sender.sendReceiveNonBlocking(payload, callback);
2) This is the content of the D:/eclipse_workspace/axis2 directory:
D:/eclipse_workspace/axis2
|
|---------conf
| |
| |---------axis2.xml
|
|---------modules
| |
| |-----------------logging.mar
| |-----------------addressing.mar
|
|---------services
| |
| |-----------------MyService.aar
| |-----------------version.aar
3) My modules are engaged in the axis2.xml with the two following commands:
<module ref="addressing"/>
<module ref="logging"/>
4) I added the logging phase in the axis2.xml:
<phaseOrder type="inflow">
<!-- System pre defined phases -->
<phase name="Transport">
<handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
</phase>
<phase name="Security"/>
<phase name="PreDispatch"/>
<phase name="Dispatch"
class="org.apache.axis2.engine.DispatchPhase">
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
<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="logging"/>
<phase name="OperationInPhase"/>
<phase name="soapmonitorPhase"/>
</phaseOrder>
<phaseOrder type="outflow">
<!-- user can add his own phases to this area -->
<phase name="logging"/>
<phase name="OperationOutPhase"/>
<phase name="soapmonitorPhase"/>
<!--system predefined phase-->
<!--these phase will run irrespective of the service-->
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
<phaseOrder type="INfaultflow">
<phase name="PreDispatch"/>
<phase name="Dispatch"
class="org.apache.axis2.engine.DispatchPhase">
<handler name="RequestURIBasedDispatcher"
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPActionBasedDispatcher"
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="AddressingBasedDispatcher"
class="org.apache.axis2.engine.AddressingBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
</handler>
<handler name="InstanceDispatcher"
class="org.apache.axis2.engine.InstanceDispatcher">
<order phase="PostDispatch"/>
</handler>
</phase>
<!-- user can add his own phases to this area -->
<phase name="logging"/>
<phase name="OperationInFaultPhase"/>
<phase name="soapmonitorPhase"/>
</phaseOrder>
<phaseOrder type="Outfaultflow">
<!-- user can add his own phases to this area -->
<phase name="logging"/>
<phase name="OperationOutFaultPhase"/>
<phase name="soapmonitorPhase"/>
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder>
5) This is my module.xml file
<module name="logging">
<Description> This is a test module! </Description>
<inflow>
<handler name="InFlowLogHandler"
class="userguide.loggingmodule.LogHandler">
<order phase="logging"/>
</handler>
</inflow>
<outflow>
<handler name="OutFlowLogHandler"
class="userguide.loggingmodule.LogHandler">
<order phase="logging"/>
</handler>
</outflow>
<Outfaultflow>
<handler name="FaultOutFlowLogHandler"
class="userguide.loggingmodule.LogHandler">
<order phase="logging"/>
</handler>
</Outfaultflow>
<INfaultflow>
<handler name="FaultInFlowLogHandler"
class="userguide.loggingmodule.LogHandler">
<order phase="logging"/>
</handler>
</INfaultflow>
</module>
6) This is the content of logging.mar
logging.mar
|
|---------META-INF
| |---------module.xml
|
|---------userguide
| |
| |-----------loggingmodule
|
|--------------LogHandler.class
|--------------LogHandler.java
7) Finally, this is the code in the LogHandler.java file
package userguide.loggingmodule;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.handlers.AbstractHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.xml.namespace.QName;
public class LogHandler extends AbstractHandler{
private static final Log log = LogFactory.getLog(LogHandler.class);
private QName name;
public QName getName() {
return name;
}
public void invoke(MessageContext msgContext) throws AxisFault {
System.out.println("TRACE LOGHANDLER --> Module LOGGING - Méthode
Invoke");
System.out.println(msgContext.getEnvelope()+"\n");
}
public void revoke(MessageContext msgContext) {
log.info(msgContext.getEnvelope().toString());
}
public void setName(QName name) {
this.name = name;
}
}
----- Original Message -----
From: "Eran Chinthaka" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, July 18, 2006 3:38 PM
Subject: Re: [AXIS2]need help
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group. It is intended only for the person to whom
it is addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this message or
any part thereof. If you receive this message in error, please notify the
sender immediately and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]