Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-4574

HTTP Gateway and URL parameters

    XMLWordPrintable

Details

    • % %
    • 6.3 Sprint 1 (4-Jan->29-Jan)

    Description

      The HTTP Gateway only works if the URI ends with a slash. if it dosn't end with a slash then the HTTP Gateway automaticly adds a slash. This Produces Errors in case the URI ends with URL Parameters.
      /x/y produces /x/y/ --> works
      /x/y/ produces /x/y/ --> works
      /x/y?a=3 produces /x/y?a=3/ --> failure

      Here is the setup

      • 1 Fabric root container with 2 fabric local child containers
      • 1 child container with restservice profile
      • 1 child container with restservice profile and http-gateway profile

      the CustomerService has a class annotation @Path("/") and the Methode "getCustomerByQueryParam" is only annotated with @GET (no @Path).
      the path .../CxfRsRouterTest/rest is configured in the Blueprint.

      blueprint.xml:

      <jaxrs:server id="restService"
                     address="/CxfRsRouterTest/rest" >
          <jaxrs:serviceBeans>
            <ref component-id="customerService"/>
          </jaxrs:serviceBeans>
        </jaxrs:server>
      

      CustomerService.java:

      @Path("/")
      public class CustomerService {
      
         private final static Logger log = LoggerFactory.getLogger(CustomerService.class);
         long currentId = 123;
         Map<Long, Customer> customers = new HashMap<Long, Customer>();
         Map<Long, Order> orders = new HashMap<Long, Order>();
      
         public CustomerService() {
            init();
         }
        ...
      
         // this is the method with parameter (@QueryParam) we tested
         @GET
         @Produces("application/xml")
         public Customer getCustomerByQueryParam(@QueryParam("id") String id) {
            log.info("got call on getCustomerByQueryParam with QueryParam=" + id);
            long idNumber = Long.parseLong(id);
            Customer c = customers.get(idNumber);
            return c;
         }
      

      we have tested the following scenarios:

      Where the port 8182 and 8183 are the pax web port on the two child containers. So the last four tests did not go through http-gateway but rather they were directly invoked on the jaxrs service.

      For more detail, please take a look at attached test case.

      Attachments

        Issue Links

          Activity

            People

              gertv_jira Gert Vanthienen (Inactive)
              rhn-support-qluo Joe Luo
              Andrej Vano Andrej Vano
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: