Calling a restful web service (non SOAP) with java

102 Views Asked by At

I'm trying to develop, using Java, a simple application that call a web-service restful which returns an xml and then I need to provide the result to a jsp page. I was thinking to use CXF but what is not clear is the fact that the restful service can have different urls with parameters like:

http://ws-host.com/rest/products?BRAND=020&LOCALE=en_gb?product_code=600200

http://ws-host.com/rest/products?BRAND=020&LOCALE=en_gb&VEHICLE_BRAND=test

or

http://ws-host.com/rest/dealers?BRAND=020&LOCALCE=en_gb&SEARCH_TERM=Test

How can I do that? I'm a bit confused. Thanks

1

There are 1 best solutions below

0
On

CXF supports JSR-339 spec so you can use this API to create your mappings with different parameters.

You can use @QueryParam annotation, here is an example