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