Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-247

HTTP POST SOAP Requests not working.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-M1
    • 2.0-M1
    • Bus
    • None

    Description

      When sending a request in the form of the example below, I recieve a no such method Body error.

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <getProductDetails xmlns="http://warehouse.example.com/ws">
      <productID>827635</productID>
      </getProductDetails>
      </soap:Body>
      </soap:Envelope>

      This is caused by a .getLocalName() call returning the <soap:Body> element in WrappedInInterceptor.java. As far as I am aware, all SOAP messages require a body, so the following should fix it:

      WrappedInInterceptor.java

      public void handleMessage(Message message) { ...
      if (operation == null) {
      // Added code
      try

      { xmlReader.nextTag(); } catch (Exception e) { throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION_ELEMENT", BUNDLE)); }
      // End of added code
      String local = xmlReader.getLocalName(); ...

      If I am mistaken and a Body element is not always required :

      public void handleMessage(Message message) { ...
      if (operation == null) {
      // Added code
      if (xmlReader.getLocalName().equals("Body")) {
      try { xmlReader.nextTag(); }

      catch (Exception e)

      { throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION_ELEMENT", BUNDLE)); }


      }
      // End of added code
      String local = xmlReader.getLocalName(); ...

      Attachments

        1. BodyRequired.patch
          0.7 kB
          Jonathan Hall
        2. BodyNotRequired.patch
          0.8 kB
          Jonathan Hall

        Activity

          People

            maomaode maomaode
            jonh Jonathan Hall
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: