Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2512

SAAJ does not conform to DOM specifications

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4
    • None
    • SAAJ
    • None

    Description

      The following test case should work

      String src = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
      "<soapenv:Body>\n" +
      "<soapenv:Fault>\n" +
      " <faultcode>soap:Client</faultcode>\n" +
      " <faultstring>Maximum amount exceeded passed in Mortgage Criteria Parameter name: [ValidateCriteria].[strCriteria.6]</faultstring>\n" +
      " <faultactor>http://www.moneyfactswebservices.com/foxtrot/mortgage.asmx</faultactor>\n" +
      " <detail/>\n" +
      "</soapenv:Fault>" +
      "</soapenv:Body>" +
      "</soapenv:Envelope>";

      MimeHeaders headers = new MimeHeaders();
      headers.addHeader("Content-Type", "text/xml;");
      InputStream is = new ByteArrayInputStream(src.getBytes());
      SOAPMessage sm = messageFactory.createMessage(headers, is);
      SOAPPart soapPart = sm.getSOAPPart();
      SOAPBody soapBody = soapPart.getEnvelope().getBody();
      SOAPElement elem = null;
      for (Iterator it = soapBody.getChildElements(); it.hasNext() {
      Object child = it.next();
      if (child instanceof SOAPElement)

      { elem = (SOAPElement) child; break; }

      }

      StringWriter buffer = new StringWriter();
      TransformerFactory.newInstance().newTransformer().transform(new DOMSource(elem), new StreamResult(buffer));
      assertEquals(elem.toString(), buffer.toString());

      Attachments

        Activity

          People

            Unassigned Unassigned
            gnodet Guillaume Nodet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: