使用java调用restful Web服务(非SOAP)

时间:2015-01-12 10:13:04

标签: java web-services rest cxf jax-ws-customization

我尝试使用Java开发一个简单的应用程序,该应用程序调用一个返回xml的web服务restful,然后我需要将结果提供给jsp页面。 我在考虑使用CXF,但不清楚的是,restful服务可以有不同的URL,其中包含以下参数:

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

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

我该怎么做?我有点困惑。 感谢

1 个答案:

答案 0 :(得分:0)

CXF支持JSR-339 spec,因此您可以使用此API创建具有不同参数的映射。

您可以使用@QueryParam注释,here is an example

相关问题