You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/11/17 11:03:52 UTC

[jira] Created: (CAMEL-2183) camel-cxf - Empty body causes http error 500 even for GET when using cxfbean

camel-cxf - Empty body causes http error 500 even for GET when using cxfbean
----------------------------------------------------------------------------

                 Key: CAMEL-2183
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2183
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-cxf
    Affects Versions: 2.0.0
            Reporter: Claus Ibsen
            Assignee: William Tam
             Fix For: 2.1.0


CxfSoapBinding has a bug that it mandates a body to exist. But when you send a GET then there is of course no body.

The code below fixed this in the method {{getCxfInMessage}}
{code}
        // body can be empty in case of GET etc.
        InputStream body = message.getBody(InputStream.class);
        if (body != null) {
            answer.setContent(InputStream.class, body);
        } else if (message.getBody() != null) {
            // fallback and set the body as what it is
            answer.setContent(Object.class, body);
        }
{code}

Willem Tam can you review if that is okay? Maybe the code can be more finer to check the HTTP method and in cases of GET etc. it allows no body.

I will commit my fix to get the unit tests passing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2183) camel-cxf - Empty body causes http error 500 even for GET when using cxfbean

Posted by "William Tam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55506#action_55506 ] 

William Tam commented on CAMEL-2183:
------------------------------------

The fix looks fine to me (although I wasn't the original author of this code).

> camel-cxf - Empty body causes http error 500 even for GET when using cxfbean
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-2183
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2183
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.0.0
>            Reporter: Claus Ibsen
>            Assignee: William Tam
>             Fix For: 2.1.0
>
>
> CxfSoapBinding has a bug that it mandates a body to exist. But when you send a GET then there is of course no body.
> The code below fixed this in the method {{getCxfInMessage}}
> {code}
>         // body can be empty in case of GET etc.
>         InputStream body = message.getBody(InputStream.class);
>         if (body != null) {
>             answer.setContent(InputStream.class, body);
>         } else if (message.getBody() != null) {
>             // fallback and set the body as what it is
>             answer.setContent(Object.class, body);
>         }
> {code}
> Willem Tam can you review if that is okay? Maybe the code can be more finer to check the HTTP method and in cases of GET etc. it allows no body.
> I will commit my fix to get the unit tests passing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-2183) camel-cxf - Empty body causes http error 500 even for GET when using cxfbean

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2183.
--------------------------------

    Resolution: Fixed

Thanks William

> camel-cxf - Empty body causes http error 500 even for GET when using cxfbean
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-2183
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2183
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.0.0
>            Reporter: Claus Ibsen
>            Assignee: William Tam
>             Fix For: 2.1.0
>
>
> CxfSoapBinding has a bug that it mandates a body to exist. But when you send a GET then there is of course no body.
> The code below fixed this in the method {{getCxfInMessage}}
> {code}
>         // body can be empty in case of GET etc.
>         InputStream body = message.getBody(InputStream.class);
>         if (body != null) {
>             answer.setContent(InputStream.class, body);
>         } else if (message.getBody() != null) {
>             // fallback and set the body as what it is
>             answer.setContent(Object.class, body);
>         }
> {code}
> Willem Tam can you review if that is okay? Maybe the code can be more finer to check the HTTP method and in cases of GET etc. it allows no body.
> I will commit my fix to get the unit tests passing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2183) camel-cxf - Empty body causes http error 500 even for GET when using cxfbean

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55491#action_55491 ] 

Claus Ibsen commented on CAMEL-2183:
------------------------------------

William I have committed at rev: 881227.

> camel-cxf - Empty body causes http error 500 even for GET when using cxfbean
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-2183
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2183
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.0.0
>            Reporter: Claus Ibsen
>            Assignee: William Tam
>             Fix For: 2.1.0
>
>
> CxfSoapBinding has a bug that it mandates a body to exist. But when you send a GET then there is of course no body.
> The code below fixed this in the method {{getCxfInMessage}}
> {code}
>         // body can be empty in case of GET etc.
>         InputStream body = message.getBody(InputStream.class);
>         if (body != null) {
>             answer.setContent(InputStream.class, body);
>         } else if (message.getBody() != null) {
>             // fallback and set the body as what it is
>             answer.setContent(Object.class, body);
>         }
> {code}
> Willem Tam can you review if that is okay? Maybe the code can be more finer to check the HTTP method and in cases of GET etc. it allows no body.
> I will commit my fix to get the unit tests passing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.