You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Tadayoshi Sato (JIRA)" <ji...@apache.org> on 2016/11/01 11:15:58 UTC

[jira] [Updated] (CAMEL-10429) CXFRS client requires Exchange.HTTP_URI instead of HTTP_PATH for Camel tranport

     [ https://issues.apache.org/jira/browse/CAMEL-10429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tadayoshi Sato updated CAMEL-10429:
-----------------------------------
    Description: 
The [camel-cxfrs doc|http://camel.apache.org/cxfrs.html] writes that {{HTTP_PATH}} is required for {{camel-cxfrs}} producer when it's used with {{httpClientAPI}} option.
{quote}
The CXF JAXRS front end also provides a http centric client API. You can also invoke this API from camel-cxfrs producer. *You need to specify the HTTP_PATH and the HTTP_METHOD* and let the producer use the http centric client API by using the URI option httpClientAPI or by setting the message header CxfConstants.CAMEL_CXF_RS_USING_HTTP_API.
{quote}
However, when Camel transport is used between CXFRS producer and consumer, the invocation succeeds only if it sets {{HTTP_URI}}, not {{HTTP_PATH}}, to the header. Otherwise it fails with {{404}} error.
{code:java}
                from("direct:input.camel")
                    .setHeader(Exchange.HTTP_METHOD, constant("GET"))
                    .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
                    .setHeader(Exchange.HTTP_URI, simple("/greeting/hello/${body}"))
                    //.setHeader(Exchange.HTTP_PATH, simple("/greeting/hello/${body}")) // <- fails
                    .inOut("cxfrs:bean:rsClient");
{code}

  was:
The [camel-cxfrs doc|http://camel.apache.org/cxfrs.html] writes that {{HTTP_PATH}} is required for {{camel-cxfrs}} producer when it's used with {{httpClientAPI}} option.
{quote}
The CXF JAXRS front end also provides a http centric client API. You can also invoke this API from camel-cxfrs producer. You need to specify the HTTP_PATH and the HTTP_METHOD and let the producer use the http centric client API by using the URI option httpClientAPI or by setting the message header CxfConstants.CAMEL_CXF_RS_USING_HTTP_API.
{quote}
However, when Camel transport is used between CXFRS producer and consumer, the invocation succeeds only if it sets {{HTTP_URI}}, not {{HTTP_PATH}}, to the header. Otherwise it fails with {{404}} error.
{code:java}
                from("direct:input.camel")
                    .setHeader(Exchange.HTTP_METHOD, constant("GET"))
                    .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
                    .setHeader(Exchange.HTTP_URI, simple("/greeting/hello/${body}"))
                    //.setHeader(Exchange.HTTP_PATH, simple("/greeting/hello/${body}")) // <- fails
                    .inOut("cxfrs:bean:rsClient");
{code}


> CXFRS client requires Exchange.HTTP_URI instead of HTTP_PATH for Camel tranport
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-10429
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10429
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxfrs
>    Affects Versions: 2.18.0
>            Reporter: Tadayoshi Sato
>
> The [camel-cxfrs doc|http://camel.apache.org/cxfrs.html] writes that {{HTTP_PATH}} is required for {{camel-cxfrs}} producer when it's used with {{httpClientAPI}} option.
> {quote}
> The CXF JAXRS front end also provides a http centric client API. You can also invoke this API from camel-cxfrs producer. *You need to specify the HTTP_PATH and the HTTP_METHOD* and let the producer use the http centric client API by using the URI option httpClientAPI or by setting the message header CxfConstants.CAMEL_CXF_RS_USING_HTTP_API.
> {quote}
> However, when Camel transport is used between CXFRS producer and consumer, the invocation succeeds only if it sets {{HTTP_URI}}, not {{HTTP_PATH}}, to the header. Otherwise it fails with {{404}} error.
> {code:java}
>                 from("direct:input.camel")
>                     .setHeader(Exchange.HTTP_METHOD, constant("GET"))
>                     .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
>                     .setHeader(Exchange.HTTP_URI, simple("/greeting/hello/${body}"))
>                     //.setHeader(Exchange.HTTP_PATH, simple("/greeting/hello/${body}")) // <- fails
>                     .inOut("cxfrs:bean:rsClient");
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)