I modifier DynamicInvoker

    public HashMap invokeMethod(
            String operationName, String portName, String[] args)
            throws Exception {
        String serviceNS = null;
        String serviceName = null;
        String operationQName = null;

        System.out.println("Preparing Axis dynamic invocation");
        Service service = selectService(serviceNS, serviceName);
        Operation operation = null;
        org.apache.axis.client.Service dpf = new 
org.apache.axis.client.Service(wsdlParser, service.getQName());

        Vector inputs = new Vector();
        Port port = selectPort(service.getPorts(), portName);
        if (portName == null) {
            portName = port.getName();
        }

        // Add handler
        HandlerRegistry hr = dpf.getHandlerRegistry();
        List handlers = hr.getHandlerChain(QName.valueOf(portName));
        handlers.add(new HandlerInfo(SimpleSessionHandler.class, new HashMap(), 
null));

to add the SimpleSessionHandler but this caused the following exception:

Reading WSDL document from 
'http://localhost:4444/cgi-bin/WebObjects/MohawkWebService.woa/ws/.MohawkWS?wsdl'
- Unable to find required classes (javax.activation.DataHandler and 
javax.mail.internet.MimeMultipart). Attachment support is disabled.
Preparing Axis dynamic invocation
Executing operation getFilters with parameters:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: javax.xml.rpc.JAXRPCException: Unable to create handler of type 
class org.apache.axis.handlers.SimpleSessionHandler
 faultActor: 
 faultNode: 
 faultDetail: 
        {http://xml.apache.org/axis/}stackTrace:javax.xml.rpc.JAXRPCException: 
Unable to create handler of type class 
org.apache.axis.handlers.SimpleSessionHandler
        at 
org.apache.axis.handlers.HandlerChainImpl.newHandler(HandlerChainImpl.java:247)
        at 
org.apache.axis.handlers.HandlerChainImpl.<init>(HandlerChainImpl.java:77)
        at 
org.apache.axis.handlers.HandlerInfoChainFactory.createHandlerChain(HandlerInfoChainFactory.java:42)
        at 
org.apache.axis.client.AxisClient.getJAXRPChandlerChain(AxisClient.java:274)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:140)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:2424)
        at org.apache.axis.client.Call.invoke(Call.java:2347)
        at org.apache.axis.client.Call.invoke(Call.java:1804)
        at 
com.mpv.wsclient.Mohawk.DynamicInvoker.invokeMethod(DynamicInvoker.java:239)
        at com.mpv.wsclient.Mohawk.DynamicInvoker.main(DynamicInvoker.java:104)

        {http://xml.apache.org/axis/}hostname:stpauligirl

javax.xml.rpc.JAXRPCException: Unable to create handler of type class 
org.apache.axis.handlers.SimpleSessionHandler
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:216)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:2424)
        at org.apache.axis.client.Call.invoke(Call.java:2347)
        at org.apache.axis.client.Call.invoke(Call.java:1804)
        at 
com.mpv.wsclient.Mohawk.DynamicInvoker.invokeMethod(DynamicInvoker.java:239)
        at com.mpv.wsclient.Mohawk.DynamicInvoker.main(DynamicInvoker.java:104)
Caused by: javax.xml.rpc.JAXRPCException: Unable to create handler of type 
class org.apache.axis.handlers.SimpleSessionHandler
        at 
org.apache.axis.handlers.HandlerChainImpl.newHandler(HandlerChainImpl.java:247)
        at 
org.apache.axis.handlers.HandlerChainImpl.<init>(HandlerChainImpl.java:77)
        at 
org.apache.axis.handlers.HandlerInfoChainFactory.createHandlerChain(HandlerInfoChainFactory.java:42)
        at 
org.apache.axis.client.AxisClient.getJAXRPChandlerChain(AxisClient.java:274)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:140)
        ... 7 more
Exception in thread "main" 

Any idea why?

Thanks!
J.R.
-----Original Message-----
From: trebor iksrazal [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 18, 2005 2:25 PM
To: [email protected]
Subject: RE: Axis 1.2 handlers


Don't At least one other way is via the
HandlerRegistry, like so: 

//add ClientHandler to chain of events
java.util.List list =
svc.getHandlerRegistry().getHandlerChain(portQN);
list.add(new
javax.xml.rpc.handler.HandlerInfo(ClientHandler.class,this.handlerConfig,null));

ClientHandler in this case simply implements Handler .
 On the client side no wsdd necessary.  

HTH, 
iksrazal 

--- "Flores, Raul" <[EMAIL PROTECTED]> wrote:

>  
> I found the following in this article: 
>
http://www.fawcette.com/javapro/2003_04/online/wsdl_kjones_04_29_03/defa
> ult_pf.aspx
> 
> 
> From above article:
> 
>  To create an Axis client that uses simple sessions,
> you need to
> configure the Axis client-side framework to use the
> handler. The
> procedure is similar to that for the server, but
> instead of deploying to
> the server, the config file is created locally. You
> do this by running
> the org.apache.axis.utils.Admin application. You run
> the code like this:
> 
> org.apache.axis.utils.Admin client deploy.wsdd
> 
> 
> 
> 
> Once you have a client-config.wsdd, you can
> configure the handler
> section same as for the server side.
> 
> Raul
> 
> 
> -----Original Message-----
> From: Coyne, Jimmy [mailto:[EMAIL PROTECTED]
> 
> Sent: Tuesday, October 18, 2005 11:45 AM
> To: '[email protected]'
> Subject: Axis 1.2 handlers
> 
> Hi all,
> Could any body show me some information on how to
> configure handlers on
> the axis client side ?
> Did a search on google , but came up with nothing .
> Thanks
> Jimmy 
> 


"None are more hopelessly enslaved than those who falsely believe they are 
free. -- Goethe"


                
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

Reply via email to