【发布时间】:2017-10-15 05:20:49
【问题描述】:
我目前正在使用 Apache CXF 3.1.11 版构建 JAX-RS 客户端。我一直在网上查看一些简单的示例,似乎 WebClient 类已经丢失。
查看下面我在网上找到的示例代码。
public static void main(String[] args) throws JsonParseException,
JsonMappingException, IOException {
WebClient client = WebClient
.create("http://localhost:8080/",
Collections.singletonList(new JacksonJsonProvider()))
.path("test").accept(MediaType.APPLICATION_JSON_TYPE);
Message message = client.get(Message.class);
System.out.println("Message recieved : " + message);
}
我在代码中的任何地方都找不到 WebClient 类,我使用以下 maven 依赖项。
- cxf-rt-frontend-jaxws
- cxf-rt-transsports-http
- cxf-rt-transports-http-jetty
请有人确认我是否缺少依赖项或 WebClient 是否已从版本 3.1.11 中删除
【问题讨论】: