PDA

View Full Version : Problem accessing wsdl for authenticated web service



cmgharris
Jun 17th, 2005, 05:05 AM
I am using spring 1.2.1, and experimenting with web services.

I have set up a simple web service using Spring and Axis, and a simple client to access it, also using Spring & JaxRpcPortProxyFactoryBean.

That works ok and I can access it with no problems.

My next step is to implement BASIC authentication. I have configured the server end, and when I try to access it without any changes to the client, I get an authentication error, as would be expected.

I then added username and password properties to the JaxRpcPortProxyFactoryBean. However when I now try to redeploy the client application, I get the error shown below.

Has anyone come accross this before? Or suggest how to solve it?

TIA


2005-06-17 10:07:00,999 INFO [org.springframework.beans.factory.support.Default ListableBeanFactory] Creating shared instance of singleton bean 'wsTestService'
2005-06-17 10:07:02,396 INFO [org.springframework.beans.factory.support.Default ListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.Default ListableBeanFactory defining beans [wsTestService,wsClientController,urlMapping1,view Resolver,configsetter]; root of BeanFactory hierarchy}
2005-06-17 10:07:02,396 ERROR [org.springframework.web.servlet.DispatcherServlet ] Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'wsTestService' defined in ServletContext resource [/WEB-INF/wsclient_config.xml]: Initialization of bean failed; nested exception is javax.xml.rpc.ServiceException: Error processing WSDL document:
java.net.ProtocolException: Server redirected too many times (20)
javax.xml.rpc.ServiceException: Error processing WSDL document:
java.net.ProtocolException: Server redirected too many times (20)
at org.apache.axis.client.Service.initService(Service .java:249)
at org.apache.axis.client.Service.<init>&#40;Service.java&#58;164&#41;
at org.apache.axis.client.ServiceFactory.createServic e&#40;ServiceFactory.java&#58;198&#41;
at org.springframework.remoting.jaxrpc.LocalJaxRpcSer viceFactory.createJaxRpcService&#40;LocalJaxRpcService Factory.java&#58;182&#41;
at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.prepare&#40;JaxRpcPortClientInterceptor. java&#58;290&#41;
at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.afterPropertiesSet&#40;JaxRpcPortClientI nterceptor.java&#58;268&#41;
at org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean.afterPropertiesSet&#40;JaxRpcPortProxyFac toryBean.java&#58;55&#41;
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods&#40;Abstr actAutowireCapableBeanFactory.java&#58;962&#41;

The Spring config for my JaxRpcPortProxyFactoryBean is:


<beans>
<bean id="wsTestService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean">
<property name="serviceFactoryClass">
<value>org.apache.axis.client.ServiceFactory</value>
</property>
<property name="wsdlDocumentUrl">
<value>http&#58;//turtle/wstest/services/WsTest?wsdl</value>
</property>
<property name="namespaceUri">
<value>http&#58;//turtle/wstest/services/WsTest</value>
</property>
<property name="serviceName">
<value>InformixDataAccessorJaxRpcImplService</value>
</property>
<property name="portName">
<value>WsTest</value>
</property>
<property name="portInterface">
<value>org.stl.wstest.data.InformixDataAccessorRemote</value>
</property>
<property name="serviceInterface">
<value>org.stl.wstest.data.InformixDataAccessor</value>
</property>
<!-- two properties added for authentication&#58; -->
<property name="username">
<value>wsuser</value>
</property>
<property name="password">
<value>wspwd</value>
</property>
</bean>