Hi all,

I'm using Apache Axis 1.4 (yes, the old one), with wsdl2java to
generate the client code for a webservice. I'd like to set additional
properties on the Call object before calling methods on the generated
stub.

For example, I'd like to set username, password, perhaps add or modify
existing headers, and change the client handlers to use different
implementations.

Currently, I'm doing this by modifying the generated Stub class and
calling the appropriate setters. However, I'd like to achieve this
without touching the generated files. I"m confused, though, because
the Stub class has:

createCall()

which creates the call object and sets some properties. Currently,
this is where I'm modifying the generated source code; then, the Stub
contains:

clientMethod1(){
    blahblah
    Call _call = createCall();
    ......
    _call.invoke();
}

So I can't see a way that I can use the serviceLocator to get a stub,
modify the properties I want to modify, and then use the stub to call
the methods I want to call, given that the stub methods call
createCall() and then call invoke. There doesn't appear to be a way to
intercept the new Call object before it's invoked.

So: How do you modify properties in the call without modifying the
generated Stub class's source code?

In my code, I can do ((Stub) myImpl).setWhatever();  for properties
that the stub class seems to pass into the Call object (username,
password). But I can't find a way to pass client handlers, for
example, because I can't find how the Stub would pass those into the
call it creates.

Basically, I want to leave the generated files untouched but still
have control over the Call object when I need it.

Thanks for guidance.

Reply via email to