[SWS-254] Add an EndpointAdapter that adapts to a MethodEndpoint for a methos with one Source param containing the payload Created: 14/Dec/07  Updated: 04/May/12  Resolved: 04/Jan/11

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: None
Fix Version/s: 2.0 GA

Type: Improvement Priority: Major
Reporter: Tom Lambrechts Assignee: Arjen Poutsma
Resolution: Complete Votes: 0
Labels: None
Remaining Estimate: 1h
Time Spent: Not Specified
Original Estimate: 1h

Attachments: Java Source File MySourceParamEndpoint.java     Java Source File SourceParamMethodEndpointAdapter.java    
Issue Links:
Related
is related to SWS-351 Arbitrary parameter injection for @En... Closed

 Description   

Make an adaptor that makes it possible to use the PayloadRoot annotation on a method taking a single parameter javax.xml.Source. The parameter should be a java.xml.Source reference to the payload of the message.
The Source param is very convinient when implementing XPath in the endpoint without using the XPathParam annotation.

@PayloadRoot(localPart = TRACKING_MESSAGE_INFO, namespace = NAMESPACE_XQ)
public Source invokeTrackingMessageInfo(Source request) throws Exception

{...}

This issue is solved by adding the class SourceParamMethodEndpointAdapter that adapts to a MethodEndpoint and supports all methods taking exactly one Source parameter.



 Comments   
Comment by Tom Lambrechts [ 14/Dec/07 ]

Implementation of Feature request

Comment by Tom Lambrechts [ 14/Dec/07 ]

Sample using XPath template in combination with payloadRoot annotation

Comment by Arjen Poutsma [ 14/Dec/07 ]

We already have the PayloadMethodEndpointAdapter, see http://static.springframework.org/spring-ws/site/apidocs/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapter.html

Is the SourceParamMethodEndpointAdapter any different than the PayloadMethodEndpointAdapter?

Comment by Tom Lambrechts [ 14/Dec/07 ]

It puzzled me too for a while, but there is a big difference.

If you define an endpoint with the annotaion PayloadRoot and MethodEndPoint is created (and that is what we want because we can have more than one method with a parameter source and and annotation @PayloadRoot)

The PayloadMethodEndpoint Adaptor can only handle classes who implement PayloadEndpoint.

The SourceParamMethodEndpointAdapter can handle MethodEndpoints that have an annotated method witch takes a sigle source param.
If you look to my sample you see where I want to go to.

Actually the PayloadMethodEndpointAdapter is a special case of a SourceParamMethodEndpointAdapter.
Tom

Comment by Arjen Poutsma [ 04/Jan/11 ]

This has been implemented as part of SWS 2.0.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Wed Dec 13 14:36:55 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.