[SWS-864] Intercept request with a payload that have not been defined in a EndpointMapping Created: 20/Feb/14 Updated: 20/Mar/14 Resolved: 25/Feb/14
|Project:||Spring Web Services|
|Reporter:||Thomas Champagne||Assignee:||Arjen Poutsma|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
With the current EndpointInterceptor implementation, it is not possible to handle a request with a payload that have not been defined in a EndpointMapping. The handleRequest method of EndpointInterceptor is called after the MessageDispather get an endpoint based on the payload request. If no endpoint is found, the MessageDispatcher throws NoEndpointFoundException (and generate with servlet a 404 error).
For example, with this payload :
But if I call with this request :
the MessageDispather throws a "no endpoint found".
I read the spring-ws code and I found two solution to fix this problem.
The first solution is to add a new method in EndPointInterceptor interface (or add a new interface) without endpoint parameter (EndpointInvocationChain mappedEndpoint) : handleRequest(MessageContext messageContext).
The second solution is to be able to define some @PayloadRoot on a method. But for this, you must create a new annotation to accept some @PayloadRoot. For example, @PayloadRoots. And for example, you could have :
|Comment by Arjen Poutsma [ 25/Feb/14 ]|
Fixed by introducing a @PayloadRoots annotation. Nice idea!