You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ramesh Reddy (JIRA)" <ji...@apache.org> on 2015/10/12 19:51:05 UTC
[jira] [Comment Edited] (CXF-6638) AsyncHTTPConduit does not allow
body payloads with "PATCH" method
[ https://issues.apache.org/jira/browse/CXF-6638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14953471#comment-14953471 ]
Ramesh Reddy edited comment on CXF-6638 at 10/12/15 5:50 PM:
-------------------------------------------------------------
[~sergey_beryozkin] I have not tested on 3.x branch, so not sure there.
Yes, I am using WebClient, my code is here [1] which may be little cryptic, but simple. Essentially below is what I am doing. Payload is of type InputStream
{code}
Bus bus = getBus(this.configFile);
if (httpMethod.equals("PATCH")) {
bus.setProperty("use.async.http.conduit", Boolean.TRUE);
bus.setExtension(new AsyncHTTPConduitFactory(bus), HTTPConduitFactory.class);
}
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setBus(bus);
bean.setAddress(baseAddress);
WebClient client = bean.createWebClient()
javax.ws.rs.core.Response response = client.invoke(httpMethod, payload);
{code}
[1] https://github.com/teiid/teiid/blob/master/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java#L154
was (Author: rareddy):
[~sergey_beryozkin] I have not tested on 3.x branch, so not sure there.
Yes, I am using WebClient, my code is here [1] which may be little cryptic, but simple. Essentially below is what I am doing. Payload is of type InputStream
{code}
Bus bus = getBus(this.configFile);
if (httpMethod.equals("PATCH")) {
bus.setProperty("use.async.http.conduit", Boolean.TRUE);
bus.setExtension(new AsyncHTTPConduitFactory(bus), HTTPConduitFactory.class);
}
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setBus(bus);
bean.setAddress(baseAddress);
WebClient client = bean.createWebClient()
javax.ws.rs.core.Response response = this.client.invoke(httpMethod, payload);
{code}
[1] https://github.com/teiid/teiid/blob/master/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java#L154
> AsyncHTTPConduit does not allow body payloads with "PATCH" method
> -----------------------------------------------------------------
>
> Key: CXF-6638
> URL: https://issues.apache.org/jira/browse/CXF-6638
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.7.14
> Reporter: Ramesh Reddy
>
> When using "PATCH" http method using the Async Http Transport, the payload is always null.
> After debugging, I saw that _AsyncHTTPConduit_ class does not override the "isChunkingSupported" method. Something like following is needed to be added to this class to allow PATCH call with payload
> {code}
> protected boolean isChunkingSupported(Message message, String httpMethod) {
> if ("PATCH".equals(httpMethod)) {
> return true;
> }
> return super.isChunkingSupported(message, httpMethod);
> }
> {code}
> There may be other methods this need to support.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)