[
https://issues.apache.org/jira/browse/AXIS2C-834?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bill Mitchell updated AXIS2C-834:
---------------------------------
Attachment: guththila_xml_writer_diff
For the source fix to problem (2) see the attached guththila_xml_writer diff.
In guththila_xml_writer, guththila_write_start_element_with_namespace() and
guththila_write_empty_element_with_namespace() each need to tolerate the
default namespace, where the caller provides a namespace URI that is not
present in the table of namespaces. In this case, the element must be
generated as in guththila_write_start/empty_element() just as if the localname
were provided without a namespace.
The attached fix restructures each of these routines to accomplish this result.
I suppose a different source fix could be generated that recognizes the
namespace is not present in the namespace array and just calls the base
guththila_write_start_element() or guththila_write_empty_element() routine and
let it handle the default case itself.
> guththila_xml_writer has problems with default namespace
> --------------------------------------------------------
>
> Key: AXIS2C-834
> URL: https://issues.apache.org/jira/browse/AXIS2C-834
> Project: Axis2-C
> Issue Type: Bug
> Components: guththila, xml/parser
> Affects Versions: Current (Nightly)
> Environment: Windows XP, Visual Studio 2005, guththila parser,
> libcurl transport
> Reporter: Bill Mitchell
> Attachments: guththila_xml_writer_diff,
> guththila_xml_writer_wrapper_diff
>
>
> 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().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]