You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Jean-Yves Baudy <jy...@free.fr> on 2004/04/08 11:16:50 UTC

RE : Xerces 2.2.0 and empty tag

Hi all,

Some investigation. With Xerces an empty tag can be detected when no 
events are raised between [start|end]Element in the Xerces handler.

Here a little patch that works for me. But I have no time to test the 
following case (no time to install an Axis Server).
	<tag ...></tag>

Can you look at this patch and implements it as is or in a proper manner 
? I will not be able to work more on this today.

Thank,

Regards,

Re: RE : Xerces 2.2.0 and empty tag

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Hi Jean-Yves,
    I aplied your pach but could not veryfy if it works.
 
    While I was trying to veryfy I identified yet another problem.
    When there are white spaces among differet tags in the XML payload (\r \n \t ' '), the xerces
parser fails to give the result. 
    It identifies white spaces as CHARACTER_ELEMENT and fails to proceed futher. (all Axis C++
server responses are single line, they do not use '\n' or indenting, but other engines do)

    The fix has to be built into the SoapDeSerializer. However I applied an 'UGLY' patch in
src/transport/axis/HttpTransport.cpp to strip white spaces as shown below.
    I tested this with Calculator.jws of Java Axis and it worked.

    I also tested the Axis Java echo sample with Axis C++ client. 
    
    The C++ client works with single element responses.
        <return xsi:type="xsd:float">1.4214</return>
    But multi element responses do not wotk with C++ client.
        <return xsi:type="soapenc:Array" soapenc:arrayType="xsd:float[2]"
xmlns:ns2="http://soapinterop.org/xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>0.0</item>
    <item>1.1111</item>
   </return>
 (i.e. echoInt work; echoIntArray and echoStruct do not)

    I am looking for a solution.
Regards,
Samisa...

Here is the patch for whitespaces. We got to fix this by rectifying deserialization code.

src/transport/axis/HttpTransport.cpp
471,486d470
<                       for( int i = 0; i <= m_PayLoad.size(); i++)
<                       {
<                               //remove whitespaces except ' '
<                               if( m_PayLoad[i] == '\n' || m_PayLoad[i] == '\r' || m_PayLoad[i]
== '\t' )
<                               m_PayLoad.erase(i--, 1);
<
<                               //remove spaces within two different tags
<                               if( m_PayLoad[i] == '>' )
<                               {
<                                       int j = i+1;
<                                       while( isspace(m_PayLoad[j] )) j++;
<                                       m_PayLoad.erase(i+1, j-(i+1));
<                               }
<
<                       }



__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/