Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-834

guththila_xml_writer has problems with default namespace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • guththila, xml/parser
    • None
    • Windows XP, Visual Studio 2005, guththila parser, libcurl transport

    Description

      The guththila xml writer appears to have several problems related to the default namespace. These appear when attempting to use the ADB stubs for the elements in the SOAP request messages, as the Axis data bindings fill in the default namespace from the WSDL.

      (1) In guththila_xml_writer_wrapper, guththila_xml_writer_wrap_namespace() has a comment indicating that the prefix is null on the default namespace. Yet it goes ahead and calls guththila_write_namespace() which requires both a prefix and a namespace URI.

      (2) In guththila_xml_wrapper.c, the routine guththila_write_start_element_with_namespace() does not understand the default namespace. It searches the table of namespaces to determine the prefix that goes with this namespace. If the namespace is not found, no XML is generated, so no element is started although the outer code assumes it is. This results in malformed XML as below:
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header></soapenv:Header>
      <soapenv:Body name="customer" exemplarHandle="master" xmlns="http://frameware.xcentrisity.com/services/"></soapenv:Body>
      </soapenv:Envelope></
      Yes, the trailing </ is not a typo. When the XML writer tries to close off 3 elements in the stack without having started one of the elements, this is the outcome.

      (3) After fixing the above problems, I discovered that the generated XML for the element inside the SOAP Body incorrectly had the URI of the namespace as the name of the element, rather than the name itself. I.e., the message contained a structure like:
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header></soapenv:Header>
      <soapenv:Body>
      <http://frameware.xcentrisity.com/services/ name="customer" exemplarHandle="master" xmlns="http://frameware.xcentrisity.com/services/"></http://frameware.xcentrisity.com/services/>
      </soapenv:Body>
      </soapenv:Envelope>
      The problem is that guththila_xml_writer_wrapper_start_element_with_namespace() is not flipping the order of the parameters as is correctly done in guththila_xml_writer_wrapper_start_element_with_namespace_prefix().

      Attachments

        1. guththila_xml_writer_diff
          12 kB
          Bill Mitchell
        2. guththila_xml_writer_wrapper_diff
          1 kB
          Bill Mitchell

        Activity

          People

            Unassigned Unassigned
            wtmitchell3 Bill Mitchell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: