Search code examples
javaspringspring-securityjax-wsweb.xml

Jax-WS and Spring-security Conflict


I have defined a Jax-WS webservice in my Spring web mvc project. All the web service methods worked fine as expected when I tested the wsdl operations using SOAP-UI.

I have included spring-security filter for authentication and authorization. Now, I could access the wsdl but could not perform any operation on it. I am getting the following error message in SOAP UI:

HTTP Status 405 - Request method 'POST' not supported

Following is the spring-security filter that I have added in web.xml:

<filter>  
    <filter-name>springSecurityFilterChain</filter-name>  
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>  
</filter>    
<filter-mapping>  
    <filter-name>springSecurityFilterChain</filter-name>  
    <url-pattern>/*</url-pattern>  
</filter-mapping>  

And,my wsdl is there at: http://localhost:8080/MyProject/MyService?wsdl

Please let me know how to overcome this issue.


Solution

  • Got it!! Included the following element in spring-security.xml:

    <http pattern="/MyService**" security="none"/>