For #1, there should be a way to dynamically deploy
client-deploy.wsdd
At least is says so on top of every client-deploy.wsdd
generated by wsdl2Java.
<!-- java org.apache.axis.utils.Admin client|server
deploy.wsdd -->
<!-- from the same directory that the Axis engine
runs -->
<deployment name="defaultClientConfig"
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="EmployeeInfo" provider="java:RPC">
<parameter name="wsdlTargetNamespace"
value="urn:EmployeeInfo"/>
<parameter name="wsdlServiceElement"
value="EmployeeInfoService"/>
<parameter name="wsdlServicePort"
value="EmployeeInfo"/>
<parameter name="className"
value="EmployeeInfo.EmployeeInfoSoapBindingStub"/>
<parameter name="wsdlPortType"
value="EmployeeInfo"/>
<parameter name="scope" value="session"/>
<parameter name="allowedMethods" value="*"/>
<requestFlow>
<handler
type="java:org.apache.axis.handlers.JAXRPCHandler">
<parameter name="className"
value="com.*****.JaxRpcHandler"/>
<parameter name="scope" value="request"/>
</handler>
</requestFlow>
<responseFlow>
<handler
type="java:org.apache.axis.handlers.JAXRPCHandler">
<parameter name="className"
value="com.*****.JaxRpcHandler"/>
<parameter name="scope" value="request"/>
</handler>
</responseFlow>
</service>
</deployment>
This particular wsdd is to insert a client handler
into a specific service's request/response chain. You
should be able to do the same with the global
request/response chain. So when you need to deploy a
new axis.jar, you just re-run the undeploy/deploy
script. I have not tried this on the client side, but
it should work.
#2 Everything you are doing seems to be correct;
try defining a handler like this:
<handler
type="java:org.apache.axis.handlers.JAXRPCHandler">
<parameter name="className"
value="com.*****.JaxRpcHandler"/>
<parameter name="scope" value="request"/>
--- "Xi, Keying" <[EMAIL PROTECTED]> wrote:
> 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
>
=== message truncated ===
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com