SOAP response message with leading XML comment is treated as invalid envelope
-----------------------------------------------------------------------------
Key: AXIS2C-796
URL: https://issues.apache.org/jira/browse/AXIS2C-796
Project: Axis2-C
Issue Type: Bug
Components: xml/om
Affects Versions: 1.1.0
Environment: Windows XP, Visual Studio 2005
Reporter: Bill Mitchell
In sending a SOAP request to a particular service, I receive a response of the
following form:
<?xml version="1.0" encoding="UTF-8" ?>
<!-- SOAP 1.1 Message - Powered by Xcentrisityâ„¢ Frameware -->
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
...
</env:Body>
</env:Envelope>
Unfortunately, when this response is received by Axis2C, it is diagnosed as
invalid, error 187, SOAP message does not contain a SOAP envelope element.
Stepping through the code reveals that axiom_stax_builder_create_om_comment()
treats a leading comment before the root node as discardable and returns a null
pointer. Then in axiom_stax_builder_next_with_token(), a null pointer returned
is treated as always being an error.
My suggested fix is that axiom_stax_builder_next_with_token() should complete
the comment element only if one is created, but should always return it as
valid and keep scanning. In particular, the comment portion of the switch
statement that reads:
case AXIOM_XML_READER_COMMENT:
val = axiom_stax_builder_create_om_comment(om_builder, env);
if (!val)
{
return -1;
}
axiom_stax_builder_end_element(om_builder, env);
break;
should read instead:
case AXIOM_XML_READER_COMMENT:
val = axiom_stax_builder_create_om_comment(om_builder, env);
if (val)
{
axiom_stax_builder_end_element(om_builder, env);
}
break;
In my particular situation, I have verified that making this change allows the
returned SOAP response to be processed correctly. I have not tested the other
case, of a malformed comment that runs off the document. I hope that the
subsequent read for more tokens will terminate nicely when it finds the
document empty.
--
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]