Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2183

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.1.0
    • camel-cxf
    • None

    Description

      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

              // 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);
              }
      

      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.

      Attachments

        Activity

          People

            wtam William Tam
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: