JAVA | CXF JAXRS非Spring客户端
我们正试图为我们的cxf jaxrs服务提供一个非spring客户端。 (不是网络客户端)
spring上下文中有以下元素(用于启用kerberos身份验证):
<http:conduit name="*.http-conduit">
<http:authorization>
<sec:AuthorizationType>Negotiate</sec:AuthorizationType>
</http:authorization>
</http:conduit>
知道如何将其转换为java代码吗
示例客户端代码:
JAXRSClientFactoryBean clientBean = new JAXRSClientFactoryBean();
clientBean.setResourceClass(ServiceClassName.class);
clientBean.setAddress(restful-service-url);
CXF文档没有明确说明这一点: http://cxf.apache.org/docs/jax-rs-client-api.html#JAX-RSClientAPI-CreatingclientsprogrammaticallywithnoSpringdependencies
谢谢,
加亚特里
# 1 楼答案
dma_k为您指出了SOAP服务的正确信息。如果您正在寻找REST服务的直接答案,请选中http://cxf.apache.org/docs/jax-rs-client-api.html#JAX-RSClientAPI-ConfiguringClientsatRuntime
此代码允许您访问REST服务的管道,然后根据需要对其进行配置。你只需要通过网络客户端。getConfig()方法
问候, 加布里埃尔