-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: jboss-fuse-6.2
-
Fix Version/s: jboss-fuse-6.3
-
Component/s: Fabric8 v1
-
Labels:
-
Environment:
http-gateway
-
Sprint:6.3 Sprint 1 (4-Jan->29-Jan)
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:
- http://localhost:9000/cxf/CxfRsRouterTest/rest?id=123 => dosn't work.
- http://localhost:9000/cxf/CxfRsRouterTest/rest/?id=123 => works.
- http://localhost:8182/cxf/CxfRsRouterTest/rest?id=123 => works.
- http://localhost:8183/cxf/CxfRsRouterTest/rest?id=123 => works.
- http://localhost:8182/cxf/CxfRsRouterTest/rest/?id=123 => works.
- http://localhost:8183/cxf/CxfRsRouterTest/rest/?id=123 => works.
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.
- causes
-
ENTESB-9477 fabric: git clone does not work through gateway-http
-
- Resolved
-
-
ENTESB-9498 Gateway-http add slash at the end of the URL
-
- Closed
-
- relates to
-
ENTESB-6686 gateway-http append forward-slash(/) to jaxrs extensionMappings url.
-
- Closed
-