Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.1
    • Component/s: Core
    • Labels:
      None

      Description

      With UriEndpointMapping you have to map the whole url in case of http protocol is used. With following class, url path instead of full uri is used. So that hostname and port is not important.

      Mapping with UriEndpointMapping and URLPathEndpointMapping
      "http://theserver:9084/service/abc" -> "/service/abc"

      Please add a class like:

       
      package org.springframework.ws.server.endpoint.mapping;
       
      import org.springframework.ws.context.MessageContext;
      import org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpointMapping;
      import org.springframework.ws.transport.WebServiceConnection;
      import org.springframework.ws.transport.context.TransportContext;
      import org.springframework.ws.transport.context.TransportContextHolder;
       
      import java.net.URI;
      import java.net.URISyntaxException;
      import java.net.URL;
      import java.util.Locale;
       
      /**
       *
       *@author Kaan Yamanyar
       */
      public class URLPathEndpointMapping extends AbstractMapBasedEndpointMapping {
       
          @Override
          protected boolean validateLookupKey(String key) {
              try {
                  new URI(key);
                  return true;
              } catch (URISyntaxException e) {
                  return false;
              }
          }
       
          @Override
          protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
              TransportContext transportContext = TransportContextHolder.getTransportContext();
              if (transportContext != null) {
                  WebServiceConnection connection = transportContext.getConnection();
                  if (connection != null) {
                      String connectionUri = connection.getUri().toString();
                      URL connectionURL = new URL(connectionUri);
                      String path = connectionURL.getPath().toLowerCase(Locale.ENGLISH);
                      logger.debug("Required endpoint: "+path);
                      return path;
                  }
              }
              return null;
          }
      }

        Activity

        yamanyar Kaan Yamanyar created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Assignee Arjen Poutsma [ arjen.poutsma ]
        Fix Version/s 2.1.1 [ 13012 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        arjen.poutsma Arjen Poutsma made changes -
        Time Spent 11m [ 660 ]
        Worklog Id 29113 [ 29113 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            yamanyar Kaan Yamanyar
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - Not Specified
              Not Specified
              Logged:
              Time Spent - 11m
              11m