我已经通过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)的情况下,如何访问响应状态?

最佳答案

尝试如下

org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws proxy = ctx.getBean(org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws.class);

Response response = proxy.method();

关于java - Spring JAX-RS客户端-获取响应状态,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41034473/

10-09 19:27