My bad, I packaged the new axis.jar wrong. Got it working now with new axis.jar under
web-inf/lib folder.
Two questions:
1) Is there any other way that I can use a new client-config.wsdd file without
re-packaging the axis.jar file, like put it under web-inf or some other directory? Or
is this closed related the web server cause web servers could have different classpath
hierarchies? I want to avoid re-packaging axis.jar cause it could be frequently
updated with new versions downloaded from axis website.
2) I got the request flow work with my handler, which is basically an example I got
from the mail list to log the process time. However, when I add the handler to the
response flow, it never gets invoked. The code of the handler is as follows:
*********************************************************************************************
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.axis.AxisFault;
import org.apache.axis.Handler;
import org.apache.axis.MessageContext;
import org.apache.axis.handlers.BasicHandler;
import java.util.Date;
public class MyHandler extends BasicHandler {
public static final String START_PROP = "MyHandler.startTime";
public static final String ELAPSED_PROP = "MyHandler.elapsedTime";
private Log log =
LogFactory.getLog("com.logicacmg.cbess.util.MyHandler");
public void invoke(MessageContext mc) throws AxisFault {
// Here we are now
long now = new Date().getTime();
log.info("start:" + now);
log.info("mc.getPastPivot():" + mc.getPastPivot());
log.info("mc.isClient():" + mc.isClient());
log.info("mc.containsProperty(START_PROP):" + mc.containsProperty(START_PROP));
log.info("mc.containsProperty(ELAPSED_PROP):" +
mc.containsProperty(ELAPSED_PROP));
if (mc.getPastPivot()) {
// We're on the response side, so the request code below
// must have already run and left us a start time.
long startTime = ((Long)mc.getProperty(START_PROP)).longValue();
Long elapsedTime = new Long(now - startTime);
// Save the elapsed time back to the MC so others can use it
mc.setProperty(ELAPSED_PROP, elapsedTime);
log.info("ELAPSED_PROP:" + elapsedTime);
} else {
// Request side - save now as the start time
mc.setProperty(START_PROP, new Long(now));
log.info("set START_PROP property:" + now);
}
}
}
*****************************************************************************************
>From the log, I can see that mc.getPastPivot() is false and "START_PROP" property
>gets set, but the response flow never gets invoked.
Here is client-config.wsdd (*** for the package name):
<requestFlow>
<handler type="java:com.***.util.MyHandler"/>
</requestFlow>
<reponseFlow>
<handler type="java:com.***.util.MyHandler"/>
</reponseFlow>
Anything wrong as to what I am doing?
Keying
-----Original Message-----
From: Vladimir Umansky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 9:48 AM
To: [EMAIL PROTECTED]
Subject: RE: Where to put client-config.wsdd
You can drop your class into 2 possible places:
1.
C:\jakarta-tomcat-4.0.4\webapps\axis\WEB-INF\classes
but make sure the directory structure matches the
package name of the class: com.zzz.Handler should be
in
C:\jakarta-tomcat-4.0.4\webapps\axis\WEB-INF\classes\com\zzz\
2. C:\jakarta-tomcat-4.0.4\classes - same thing with
the package name.
--- "Xi, Keying" <[EMAIL PROTECTED]> wrote:
> Not really. I tried that and got an
> "ClassNotFoundException". I think axis is reading
> the new config file, but for some reason it can't my
> handler class which is in the classpath.
>
>
>
> -----Original Message-----
> From: Vladimir Umansky
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 23, 2003 9:36 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Where to put client-config.wsdd
>
>
>
> If you exchange the new file for the one that is
> currently in axis.jar - it will work.
>
> --- "Xi, Keying" <[EMAIL PROTECTED]> wrote:
> > > I am having problems get my client handler
> > invoked. I have created the client-config.wsdd
> > file and inserted my handler in it.
> > >
> > > ***************************************
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <deployment
> > xmlns="http://xml.apache.org/axis/wsdd/"
> >
>
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> > > <globalConfiguration>
> > > <parameter name="adminPassword"
> value="admin"/>
> > > <parameter name="sendXsiTypes" value="true"/>
> > > <parameter name="sendMultiRefs" value="true"/>
> > > <parameter name="sendXMLDeclaration"
> > value="true"/>
> > > <parameter name="axis.sendMinimizedElements"
> > value="true"/>
> > > <requestFlow>
> > > <handler
> > type="java:com.mycompany.util.MyHandler"/>
> > > </requestFlow>
> > > </globalConfiguration>
> > > <transport name="http"
> >
>
pivot="java:org.apache.axis.transport.http.HTTPSender"/>
> > > <transport name="local"
> >
>
pivot="java:org.apache.axis.transport.local.LocalSender"/>
> > > <transport name="java"
> >
>
pivot="java:org.apache.axis.transport.java.JavaSender"/>
> > > </deployment>
> > >
> *************************************************
> > >
> > > My web application is deployed in Tomcat and it
> > uses Axis client. "axis.jar" is included as one of
> > jar files in the application web-inf\lib
> directory.
> > The problem is "axis.jar" has a client-config.wsdd
> > file included already, under
> org.apache.axis.client
> > directory. I tried to put my client-config.wsdd
> > right under web-inf\classes, the handler is not
> > invoked. I tried to add the following line in
> > tomcat.bat file:
> > >
> > > set
> >
>
TOMCAT_OPTS=-Daxis.ClientConfigFile=c:\client-config.wsdd
> > >
> > > That didn't work, seems like tomcat can't find
> the
> > file, although the path is right.
> > >
> > > I tried to replace the client-config.wsdd with
> my
> > own in the axis.jar and replace axis.jar with the
> > new axis.jar in my application. This time I got a
> > "Class not found exception". I think it's because
> > axis can't find my handler class,
> > com.mycompany.util.MyHandler.
> > >
> > >
> > > Anyone who has successfully used
> > client-config.wsdd with axis as a jar file in your
> > application? thanx.
> > >
> > >
> > > Keying
> > >
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> http://sitebuilder.yahoo.com
>
> This e-mail and any attachment is for authorised use
> by the intended recipient(s) only. It may contain
> proprietary material, confidential information
> and/or be subject to legal privilege. It should not
> be copied, disclosed to, retained or used by, any
> other party. If you are not an intended recipient
> then please promptly delete this e-mail and any
> attachment and all copies and inform the sender.
> Thank you.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
This e-mail and any attachment is for authorised use by the intended recipient(s)
only. It may contain proprietary material, confidential information and/or be subject
to legal privilege. It should not be copied, disclosed to, retained or used by, any
other party. If you are not an intended recipient then please promptly delete this
e-mail and any attachment and all copies and inform the sender. Thank you.