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>(Service.java:164)
at org.apache.axis.client.ServiceFactory.createServic e(ServiceFactory.java:198)
at org.springframework.remoting.jaxrpc.LocalJaxRpcSer viceFactory.createJaxRpcService(LocalJaxRpcService Factory.java:182)
at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.prepare(JaxRpcPortClientInterceptor. java:290)
at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.afterPropertiesSet(JaxRpcPortClientI nterceptor.java:268)
at org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean.afterPropertiesSet(JaxRpcPortProxyFac toryBean.java:55)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:962)
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://turtle/wstest/services/WsTest?wsdl</value>
</property>
<property name="namespaceUri">
<value>http://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: -->
<property name="username">
<value>wsuser</value>
</property>
<property name="password">
<value>wspwd</value>
</property>
</bean>
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>(Service.java:164)
at org.apache.axis.client.ServiceFactory.createServic e(ServiceFactory.java:198)
at org.springframework.remoting.jaxrpc.LocalJaxRpcSer viceFactory.createJaxRpcService(LocalJaxRpcService Factory.java:182)
at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.prepare(JaxRpcPortClientInterceptor. java:290)
at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.afterPropertiesSet(JaxRpcPortClientI nterceptor.java:268)
at org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean.afterPropertiesSet(JaxRpcPortProxyFac toryBean.java:55)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:962)
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://turtle/wstest/services/WsTest?wsdl</value>
</property>
<property name="namespaceUri">
<value>http://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: -->
<property name="username">
<value>wsuser</value>
</property>
<property name="password">
<value>wspwd</value>
</property>
</bean>