我已经通过spring上下文注入了一个JAX-RS客户端,如下所示:
<jaxrs:client id="restClient"
address="http://localhost:${testutil.ports.BookServerRestSoap}/test/services/rest"
serviceClass="org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws">
</jaxrs:client>
如何在成功响应(200、202、204)的情况下访问响应状态?
发布于 2016-12-08 17:08:45
尝试如下所示:
org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws proxy = ctx.getBean(org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws.class);
Response response = proxy.method();
发布于 2018-05-31 18:40:19
我遵循了这篇文章https://java2blog.com/restful-web-services-jaxrs-crud-example/#comment-11493中定义的相同步骤。我还没有在我的本地文件中更改任何文件。但最后,http://localhost:8080/JAXRSJsonCRUDExample/rest/countries说404问题。http://localhost:8080/JAXRSJsonCRUDExample/在浏览器中显示“Hello World”。
https://stackoverflow.com/questions/41034473
复制相似问题