Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Presetting Call properties in Apache Axis stub via wsdl2java

843833Apr 9 2010 — edited Apr 11 2010
Hello,

I am using Axis-1 1.4, and have spent two days looking around for a guide on how to pre-set Call properties via wsdl2java so that I don't have to modify the generated client.

I see that somebody has posted the same question: [Apache Axis: How to set call properties using code generated from wsdl2java?|http://stackoverflow.com/questions/2124582/apache-axis-how-to-set-call-properties-using-code-generated-from-wsdl2java] but there is no response.

Right now we are doing very ugly things via Ant. We generate the client stubs, which are extended from org.apache.axis.client.Stub, then we use Ant to text edit the generated stub code.

wsdl2java generates something like this...
    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
.
.
            if (super.cachedUsername != null) {
                _call.setUsername(super.cachedUsername);
            }

            if (super.cachedPassword != null) {
                _call.setPassword(super.cachedPassword);
            }
.
.
            java.util.Enumeration keys = super.cachedProperties.keys();

            while (keys.hasMoreElements()) {
                java.lang.String key = (java.lang.String) keys.nextElement();
                _call.setProperty(key, super.cachedProperties.get(key));
            }
.
.
}
I want to either be able to preset cachedUsername and cachedPassword or preset cachedProperties with Call.USERNAME_PROPERTY and Call.PASSWORD_PROPERTY via wsdl2java .

Is this possible? Is it something so simple and obvious as the nose on my face that everybody assumes that everybody else knows how to do it? :)

This document [org.apache.axis.client.Call|http://ws.apache.org/axis/java/apiDocs/org/apache/axis/client/Call.html] says +"It can be prefilled by a WSDL document (on the constructor to the Service object)"+, but I need some help here...

Any suggestions (besides upgrading to Axis2 - not possible) are welcome !

Edited by: sbarr10 on Apr 9, 2010 10:21 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2010
Added on Apr 9 2010
8 comments
1,565 views