Hi Venkat et al.,
thanks a lot for your answer. I have tried both of your tipps but unfortunatly I did not proceed though both ideas worked more or less (see below for details).
I started believing that my problem isn't an issue with the code but maybe with the chain's namespace so that the handler is not invoked because it's not referenced correctly?
Venkat Reddy wrote:
1. Instead of getting the chain by calling service.getHandlerRegistry().getHandlerChain(), you can just create a new ArrayList instance and add your handlerInfo to it and then set your handler chain with the new List.
To find out what difference it makes using your code versus mine (see my initial mail for the latter) I inspected the Service instance after setting the chain (your code) resp. adding the handlerInfo instance (my code). As far as I can see, the service.registry.map.table[] member is the one of interest. In either cases this member has the following values:
s.r.m.t[].key.localpart="MyService" s.r.m.t[].key.namespaceURI="http://mycompany/axis/services/MyService" s.r.m.t[].value.element[].config=Collections$EmptyMap s.r.m.t[].value.element[].handlerClass=class mycomp.MyJaxRpcHandler s.r.m.t[].value.element[].headers=QName[0]
The only difference is the index of the table[] member. Btw: does someone have a clue why handlerInfos are added at some arbitrary index like table[12] or table[16] rather than at the first available (which would be table[0] here?!)
Venkat Reddy wrote:
2. Use client-deploy.wsdd to deploy your handler and specify the handler type as JAXPRCHandler the <handler> element. Ex: <handler type="java:org.apache.axis.handlers.JAXRPCHandler">
To use the client-config I hade to create the Service instance with another constructor. Instead of
Service service = new Service();
I had to use
EngineConfiguration conf = new FileProvider("client-config.wsdd");
Service service = new Service(conf);To create my private copy of client-config.wsdd I extracted the default client config from axis.jar/org/apache/axis/client/client-config.wsdd and added handler elements with two alternatives:
Alternative 1:
<?xml version="1.0" encoding="UTF-8"?>
<deployment [...] >
<handler name="MyJaxRpcHandlerWrapper"
type="java:org.apache.handlers.JAXRPCHandler">
<parameter name="className"
value="mypackage.MyJaxRpcHandler"/>
</handler>
<service name="MyService" provider="java:RPC">
<requestFlow>
<handler type="MyJaxRpcHandlerWrapper" />
</requestFlow>
</service>
<transport name="http" [...] />
<transport name="local" [...] />
<transport name="java" [...] />
</deployment>Printed lifecycle events: none
Alternative 2:
<?xml version="1.0" encoding="UTF-8"?>
<deployment [...] >
<service name="MyService" provider="java:RPC">
<handlerInfoChain>
<handlerInfo classname="mypackage.MyJaxRpcHandler" />
</handlerInfoChain>
</service>
<transport name="http" [...] />
<transport name="local" [...] />
<transport name="java" [...] />
</deployment>Printed lifecycle events: "MyJaxRpcHandler static initialization"
Regards Willy
