Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-254

Add an EndpointAdapter that adapts to a MethodEndpoint for a methos with one Source param containing the payload

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.0 GA
    • Component/s: Core
    • Labels:
      None

      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.

      1. MySourceParamEndpoint.java
        1 kB
        Tom Lambrechts
      2. SourceParamMethodEndpointAdapter.java
        3 kB
        Tom Lambrechts

        Issue Links

          Activity

          tola2000 Tom Lambrechts created issue -
          Hide
          tola2000 Tom Lambrechts added a comment -

          Implementation of Feature request

          Show
          tola2000 Tom Lambrechts added a comment - Implementation of Feature request
          tola2000 Tom Lambrechts made changes -
          Field Original Value New Value
          Attachment SourceParamMethodEndpointAdapter.java [ 13196 ]
          Hide
          tola2000 Tom Lambrechts added a comment -

          Sample using XPath template in combination with payloadRoot annotation

          Show
          tola2000 Tom Lambrechts added a comment - Sample using XPath template in combination with payloadRoot annotation
          tola2000 Tom Lambrechts made changes -
          Attachment MySourceParamEndpoint.java [ 13197 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          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?

          Show
          arjen.poutsma Arjen Poutsma added a comment - 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?
          Hide
          tola2000 Tom Lambrechts added a comment -

          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

          Show
          tola2000 Tom Lambrechts added a comment - 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
          arjen.poutsma Arjen Poutsma made changes -
          Fix Version/s 1.6 [ 10981 ]
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue is related to SWS-351 [ SWS-351 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          This has been implemented as part of SWS 2.0.

          Show
          arjen.poutsma Arjen Poutsma added a comment - This has been implemented as part of SWS 2.0.
          arjen.poutsma Arjen Poutsma made changes -
          Resolution Complete [ 8 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Closing old issues

          Show
          arjen.poutsma Arjen Poutsma added a comment - Closing old issues
          arjen.poutsma Arjen Poutsma made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          1117d 3h 10m 1 Arjen Poutsma 04/Jan/11 3:44 AM
          Resolved Resolved Closed Closed
          486d 3h 18m 1 Arjen Poutsma 04/May/12 7:03 AM

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              tola2000 Tom Lambrechts
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified