ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suresh Janardhanan <suresh.janardha...@gmail.com>
Subject XMLInputFactory.properties
Date Thu, 19 Jan 2012 01:36:29 GMT
Andreas,

Thanks for your response. You pointed out that the <![CDATA[ section is
actually a character section. But since the soap envelope is getting sent
with invalid XML characters the Target .Net web service is sending a code
back, which interprets to invalid XML parameters format.

2012-01-18 13:35:20,422 [main] DEBUG httpclient.wire.content  - >> "<?xml
version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns1:RetrieveByParameter
xmlns:ns1="http://wsdl.echelon.com/Panoramix/
"><sKey>e1839da0c11c4058928b650f97c06853</sKey><sIDTypeID>f76e5d708edd464593bb031f646990b6</sIDTypeID><sID>100063728-E2L-NC01SC01</sID><sXmlParameters>&lt;![CDATA[&lt;PARAMETERS>&lt;RETURN>&lt;GENERALINFORMATION>&lt;INFORMATIONRETURNTYPEID>3294f665bc644359bfd15824d2efe29c&lt;/INFORMATIONRETURNTYPEID>&lt;/GENERALINFORMATION>&lt;/RETURN>&lt;/PARAMETERS>]]&gt;</sXmlParameters></ns1:RetrieveByParameter></soapenv:Body></soapenv:Envelope>"

Do you know if there is a way to send the XML string as is?

<![CDATA[<PARAMETERS><RETURN><GENERALINFORMATION><INFORMATIONRETURNTYPEID>3294f665bc644359bfd15824d2efe29c</INFORMATIONRETURNTYPEID></GENERALINFORMATION></RETURN></PARAMETERS>]]>

Thanks much for your help,
Suresh

On Wed, Jan 18, 2012 at 19:29, Janardhanan, Suresh B
<Suresh.Janardhanan@duke-energy.com> wrote:
> Is there any way to find out if the XMLInputFactory.properties
> “javax.xml.stream.isCoalescing=false” is getting overridden.

No. The settings in XMLInputFactory.properties can only be overridden
by a StAXParserConfiguration object, but this doesn't generate any
debug logs. Axis2 uses StAXParserConfiguration.SOAP, but that
configuration doesn't change the javax.xml.stream.isCoalescing
property.

> From
> StAXUtils.java -> newXMLInputFactory() method, there is no debug line, which
> shows what property is getting set. I was able to print the key, value pair
> using the following code.

If you enable debug logging on StAXUtils, it will actually output that
information in the loadFactoryProperties method, but this occurs only
once because the factory is cached.

> ClassLoader is able to find the
> XMLInputFactory.properties file but I can still see that CDATA string is not
> preserved in the logs.

Short answer: that is because there are no CDATA sections to preserve...

Long answer: With Woodstox (other parsers require additional
settings), javax.xml.stream.isCoalescing=false can be used to make
sure that CDATA sections are reported with a distinct event type (and
not as CHARACTERS events), so that the syntactic information about
CDATA sections is not lost in the object model built by Axiom (which
is generally not a problem because a CDATA section is a purely
syntactic construct, but is not supposed to carry any semantic
meaning).

The logs you have shown actually indicate that the message that is
being parsed doesn't contain any CDATA section:

2012-01-18 11:10:34,587 [main] DEBUG httpclient.wire.content  - << "<?xm"
2012-01-18 11:10:34,588 [main] DEBUG httpclient.wire.content  - << "l
version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><RetrieveByParameterResponse
xmlns="http://wsdl.echelon.com/Panoramix/"><RetrieveByParameterResult
xmlns="">&lt;RETURNS&gt;&lt;STATUS&gt;8a27cb8afd464686a3893f4f8db26540&lt;/STATUS&gt;&lt;APIPAYLOAD
/&gt;&lt;/RETURNS&gt;</RetrieveByParameterResult></RetrieveByParameterResponse></soap:Body></soap:Envelope>"

Note that even your output message doesn't contain any CDATA section:

2012-01-18 11:10:34,560 [main] DEBUG httpclient.wire.content  - >>
"<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns1:RetrieveByParameter
xmlns:ns1="http://wsdl.echelon.com/Panoramix/"><sKey>d0fa5e6038dc4a3091a590834cd5cc11</sKey><sIDTypeID>f76e5d708edd464593bb031f646990b6</sIDTypeID><sID>100063728</sID><sXmlParameters>&lt;![CDATA[&lt;PARAMETERS>&lt;RETURN>&lt;GENERALINFORMATION>&lt;INFORMATIONRETURNTYPEID>3294f665bc644359bfd15824d2efe29c&lt;/INFORMATIONRETURNTYPEID>&lt;/GENERALINFORMATION>&lt;/RETURN>&lt;/PARAMETERS>]]&gt;</sXmlParameters></ns1:RetrieveByParameter></soapenv:Body></soapenv:Envelope>"

"&lt;!CDATA[" is not a CDATA section, but character data that
represents "<![CDATA[" (in the same way as "List&lt;String>" is
character data that represents "List<String>" and not a text node
followed by a "String" element).

Mime
View raw message