We are using Axis 1.2.1 and Spring 2.0.x to invoke a remote webservice using a password callback defined in a client-deploy.wsdd file as follows:
This sends our username and password with *all* webservices invoked through the Axis (client). However, we would like to configure which username and password have to be used for each service individually.Code:<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender" /> <globalConfiguration> <requestFlow> <handler type="java:org.apache.ws.axis.security.WSDoAllSender"> <parameter name="action" value="UsernameToken" /> <parameter name="user" value="USERNAME" /> <parameter name="passwordCallbackClass" value="package.PasswordCallback" /> <parameter name="passwordType" value="PasswordText" /> <parameter name="mustUnderstand" value="false" /> </handler> </requestFlow> </globalConfiguration> </deployment>
In our Spring configuration we define a webservice (client) as follows, extending a JaxRpcPortProxyFactoryBean by package.MyServiceJaxRpcPortProxy:
Do you know if and how it would be possible to configure Spring (by overriding the base class, maybe?) for a specific JaxRpcPortProxy in which we could define a custom username per service (for instance by changing the wsdd) ?Code:<bean id="MyServiceBean" class="package.MyServiceJaxRpcPortProxy"> <property name="serviceFactoryClass" value="org.apache.axis.client.ServiceFactory" /> <property name="wsdlDocumentUrl" value="http://host/MyService.wsdl" /> <property name="namespaceUri" value="http://host/myservice" /> <property name="serviceName" value="MyService" /> <property name="portName" value="MySOAPPort" /> <property name="serviceInterface" value="package.MyService" /> </bean>
Thanks in advance, best regards,
Nicolas


Reply With Quote