I was trying to call a API with PATCH method using CXF (Version 3.1.3) client.
Tried following the steps specified in below threads but not able resolve. Only getting URLConnectionHttpConduit instead of AsyncHttpConduit
http://cxf.apache.org/docs/asynchronous-client-http-transport.html
How to use PATCH method in CXF
Verifying CXF HttpAsyncClient use of use.async.http.conduit contextual property
Here is the code snippet:
Bus bus = BusFactory.getDefaultBus();
// insist on the async connector to use PATCH.
bus.setProperty(AsyncHTTPConduit.USE_ASYNC,
AsyncHTTPConduitFactory.UseAsyncPolicy.ALWAYS);
WebClient webClient = WebClient.create(request.getRestURL());
WebClient.getConfig(webClient).getBus().setProperty
(AsyncHTTPConduit.USE_ASYNC, AsyncHTTPConduitFactory.UseAsyncPolicy.ALWAYS);
WebClient.getConfig(webClient).getRequestContext()
.put(AsyncHTTPConduit.USE_ASYNC, AsyncHTTPConduitFactory.
UseAsyncPolicy.ALWAYS);
HTTPConduit conduit = (HTTPConduit)WebClient.getConfig(webClient)
.getConduit();
System.out.println(conduit.getClass().getName());
Response response = webClient.invoke(request.getMethod(), null);
System.out.println("service response = "+ response);
I even tried using X-HTTP-Method-Override=PATCH header with a POST request,
Other side service is implemented using RestEasy and look's like not honoring X-HTTP-Method-Override header.
Can you please help me finding the issue.