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

Camel Spring-WS and AbstractAddressingEndpointMapping

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.1.3
    • Component/s: Core
    • Labels:
      None

      Description

      Beste Arjen!

      I am developing Camel support for Spring-WS, currently I am working on WS-Addressing issues. Could you help me please?

      Imagine I would like to specify the camel configuration like this:

      <camelContext>
      <from uri="spring-ws:action:http://consumerOfwsaActionWithReplyTo.com?messageSender=#myCustomBean&endpointMapping=WSACamelSpringWSEndpoint''>
      ...
      <camelContext>

      The camel endpoint (WSACamelSpringWSEndpoint) that implements SoapEndpointMapping inherits from the AbstractAddressingEndpointMapping, but in order to provide custom messageSenders from the camel uri as you see above I need to change the method AbstractAddressingEndpointMapping#getEndpointInvocationChain so I can supply my message sender.

      So, is it possible to create at least method called getMessageSender(Object endpoint) so I can easily hook different endpoint's message senders? E.g. here is the code with the appropriated changes marked bold:

      public abstract class AbstractAddressingEndpointMappingHacked extends TransformerObjectSupport
      implements SoapEndpointMapping, InitializingBean, Ordered {

      .....

       /**
           * Creates a {@link SoapEndpointInvocationChain} based on the given endpoint and {@link
           * org.springframework.ws.soap.addressing.version.AddressingVersion}.
           */
          protected EndpointInvocationChain getEndpointInvocationChain(Object endpoint,
                                                                     AddressingVersion version,
                                                                     MessageAddressingProperties requestMap) {
              URI responseAction = getResponseAction(endpoint, requestMap);
              URI faultAction = getFaultAction(endpoint, requestMap);
              
              WebServiceMessageSender[] messageSenders = getMessageSenders(endpoint);
              MessageIdStrategy messageIdStrategy = getMessageStrategy(endpoint);
       
              EndpointInterceptor[] interceptors =
                      new EndpointInterceptor[preInterceptors.length + postInterceptors.length + 1];
              System.arraycopy(preInterceptors, 0, interceptors, 0, preInterceptors.length);
              AddressingEndpointInterceptor interceptor = new AddressingEndpointInterceptor(version, messageIdStrategy,
                      messageSenders, responseAction, faultAction);
              interceptors[preInterceptors.length] = interceptor;
              System.arraycopy(postInterceptors, 0, interceptors, preInterceptors.length + 1, postInterceptors.length);
              return new SoapEndpointInvocationChain(endpoint, interceptors, actorsOrRoles, isUltimateReceiver);
          }
          
          /**
           * Default implementation
           * @param endpoint specific message strategy
           * @return
           */
          protected MessageIdStrategy getMessageStrategy(Object endpoint) {
             return this.messageIdStrategy;
          }
       
          /**
           * Default implementation
           * @param endpoint
           * @return endpoint specific message senders
           */
          protected WebServiceMessageSender[] getMessageSenders(Object endpoint) {
             return this.messageSenders;
          }
          
          public final WebServiceMessageSender[] getMessageSenders() {
              return this.messageSenders;
          }
       

      Thank you very much for your support and cooperation!
      Andrej

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        124d 19h 11m 1 Arjen Poutsma 09/Apr/13 2:43 AM
        In Progress In Progress Resolved Resolved
        38m 17s 1 Arjen Poutsma 09/Apr/13 3:21 AM

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            azachar Andrej Zachar
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: