Hi

The problem is that HTTPUrlConnection does not support HTTP methods it is not already statically aware of.

One option will be likely to use the HTTP async transport (which Dan made to work even in the sync mode) - that one is based on Apache HTTPClient, another option is to attempt to statically modify HTTPURLConnection...


Let me experiment a bit and get back to you.

Thanks, Sergey

On 25/06/13 16:49, Fabio Martelli wrote:
Hi All,
I'm facing with the WebClient in order to send a PATCH request to an
OData service.
I tried with the following statement

final Response res = client.invoke("PATCH", obj);

but the following exception has been thrown

javax.ws.rs.client.ClientException: javax.ws.rs.client.ClientException:
org.apache.cxf.interceptor.Fault: Could not send Message.
     at
java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:428)
     at
org.apache.cxf.transport.http.URLConnectionHTTPConduit.setupConnection(URLConnectionHTTPConduit.java:119)

     at
org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:467)
     at
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)

     at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)

     at
org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:607)

     at
org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1017)

     at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:855)
     at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:829)
     at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:294)
     .....

Is there someone that can help me to achieve my target?

Thank you in advance.

Best regards,
F.



--

Reply via email to