Announcement Announcement Module
Collapse
No announcement yet.
WS returning response code 302 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • WS returning response code 302

    Hi All,

    This is my web service configuration file . I have exposed it , i dont know how third party is invoking it .

    I have tested it with SOAP UI tool and it is working file. But third party has raised a issue that they are getting

    "302 Moved Temparory " response



    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sws="http://www.springframework.org/schema/web-services"
    	xmlns:p="http://www.springframework.org/schema/p" xmlns:security="http://www.springframework.org/schema/security"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans 
                               http://www.springframework.org/schem...ring-beans.xsd
                               http://www.springframework.org/schema/context
                               http://www.springframework.org/schem...ng-context.xsd
    						   http://www.springframework.org/schema/security
    		http://www.springframework.org/schem...curity-3.0.xsd
    						   http://www.springframework.org/schema/web-services
          http://www.springframework.org/schema/web-services/web-services-2.0.xsd">
    	<sws:annotation-driven />
    	<context:component-scan base-package="com.x.y.webservice.service" />
    	<!-- Enables Method-Security-Interceptor. Method calls can be secured using 
    		the annotation @Secured('<Permission-Name>') refer "Method Security" -->
    	<security:global-method-security
    		proxy-target-class="true" pre-post-annotations="enabled">
    		<security:expression-handler ref="permissionExpressionHandler" />
    	</security:global-method-security>
    	
    	<bean id="WS"
    		class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">		
    		<property name="schemaCollection" ref="schemaCollection" />
    		<property name="portTypeName" value="WS" />
    		<property name="locationUri" value="http://localhost:8080/WS/services" />
    		<property name="targetNamespace" value="http://localhost:8080/WS/services" />
    	</bean>
    
    	<bean id="schemaCollection"
    		class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">		
    		<property name="xsds">
    			<list>
    				<value>/WEB-INF/XMLschemas/WSfile.xsd</value>			
    			</list>
    		</property>
    		<property name="inline" value="true" />
    	</bean>
    
    	<!-- Interceptors here -->
    	<sws:interceptors>
    		
    		<bean id="loggingInterceptor"
    			class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">
    			<property name="logRequest" value="true" />
    			<property name="logResponse" value="true" />
    		</bean>
    		<bean id="wsSecurityInterceptor"
    			class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
    			<description>
    				This interceptor validates incoming messages by the
    				UsernameToken with a password digest in it, that all incoming
    				requests
    				must have. The actual authentication is performed by the
    				Spring Security callback handler.
    			</description>
    			<property name="secureResponse" value="false" />
    			<property name="validationActions" value="UsernameToken" />
    			<property name="validationCallbackHandler" ref="springSecurityHandler" />
    		</bean>
    	</sws:interceptors>
    
    	<bean id="springSecurityHandler"
    		class="org.springframework.ws.soap.security.wss4j.callback.SpringPlainTextPasswordValidationCallbackHandler">
    		<property name="authenticationManager" ref="wsAuthenticationManager" />
    	</bean>
    
    	<bean id="wsAuthenticationManager"
    		class="org.springframework.security.authentication.ProviderManager">
    		<property name="providers">
    			<ref bean="daoAuthenticationProvider" />
    		</property>
    	</bean>
    
    	<bean
    		class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
    		<property name="marshaller" ref="jaxb2Marshaller" />
    		<property name="unmarshaller" ref="jaxb2Marshaller" />
    	</bean>
    
    	<bean id="jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
    
    		<property name="classesToBeBound">
    			<list>
    				
    				<value>com.ws.PersonRequest</value>
    			</list>
    		</property>
    	</bean>
    	<!-- WebService Implementations here -->
    	
    	<bean id="wsService"
    		class="com.xy.webservice.service.services.impl.SomeProcessingServiceImpl">
    		<property name="someValidationManager" ref="someValidationManager" />
    		<property name="someResponseManager" ref="someResponseManager" />
    	</bean>
    </beans>


    Can anyone know about why it is returning 302 response?

    Thanx in advance
    Last edited by umesh8181; Apr 9th, 2013, 07:15 AM. Reason: Added comment

  • #2
    Please use [ code][/code ] tags when posting code/xml/stacktraces, that way it remains readable, currently it isn't...

    Judging from the garbled xml you are using Spring Security and I suspect either a misconfiguration for the credentials on your end or the wrong credentials on the other end.

    Comment


    • #3
      Thanks for quick reply Marten .

      It works fine first time at other end also. The problem is second time and ... when it invokes .

      Comment


      • #4
        Figure out what is happening and what the difference is between the requests... I still think it is something in your security configuration and/or something that is missing in the second request...

        So enable logging, write the messages and check messages and your logging...

        Comment

        Working...
        X