[SWS-474] Interceptor on endpoint Created: 08/Jan/09  Updated: 27/Jun/12  Resolved: 27/Jun/12

Status: Resolved
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.5.5
Fix Version/s: 2.0 GA

Type: Improvement Priority: Major
Reporter: Thomas Champagne Assignee: Arjen Poutsma
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

With the current implementation, it's not possible to define an EndpointInterceptor on a particular endpoint. You can only add interceptors on EndpointMapping so in a group of endpoint.

When you use annotations (@Endpoint), you have only one EndpointMapping (AnnotationMethodEndpointMapping) for all endpoints and you can not define an interceptor for one method.

Personally, I would like secured some methods but not all with the XwsSecurityInterceptor. But with the AnnotationMethodEndpointMapping, I can't do that.

A thread in the forum about this problem.



 Comments   
Comment by omar elmandour [ 04/Feb/11 ]

It seems already implemented in the class
PayloadRootSmartSoapEndpointInterceptor & SoapActionSmartEndpointInterceptor
since 2.0.

Comment by Thomas Champagne [ 26/Jun/12 ]

I'm agree with ramo roudnamle :-D
For example with this spring-ws 1.x config :

<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
  <property name="mappings">
    <props>
      <prop key="{hxxp://blah.com:8080/api/blah/v1}getBlahRequest">getBlahRequestEndpoint</prop>
      <prop key="{hxxp://blah.com:8080/api/blah/v1}SaveBlahRequest">saveBlahRequestEndpoint</prop>   	             	              	        	
      <prop key="{hxxp://blah.com:8080/api/blah/v1}GetAllActiveRequest">getAllActiveRequestEndpoint</prop>             	
    </props>
  </property>
  <property name="interceptors">
    <list>
      <ref local="validationInterceptor"/>       
    </list>
  </property>        
</bean>

You can define with spring-ws 2.0 :

<sws:interceptors>
  <sws:payloadRoot namespaceUri="{hxxp://blah.com:8080/api/blah/v1}">
    <bean class="validationInterceptor"/>
  </sws:payloadRoot>
</sws:interceptors>

So, this issue can be closed with version 2.0.

Comment by Arjen Poutsma [ 27/Jun/12 ]

Resolved as fixed, thanks for pointing this out!

Generated at Mon Dec 11 00:26:59 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.