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 Hatim Daginawala <Ha...@argodata.com> on 2008/07/31 19:26:07 UTC

axiom_node_serialize does not serialize namespaces properly

Hi All,

 

Here is the sample XML I am working with:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

    <s:Header>

        <h:guid s:mustUnderstand="1"
xmlns:h="http://localhost/namespce/header/">00000000-0000-0000-0000-0000
00000001</h:guid>

    </s:Header>

    <s:Body>

        <EchoParm xmlns="http://localhost/namespce/body/">

            <str>Response: Hello EchoEx</str>

        </EchoParm>

    </s:Body>

</s:Envelope>

 

When I retrieve guid node and serialize it with libxml2 the XML I get
is:

<h:guid s:mustUnderstand="1"
xmlns:h="http://localhost/namespce/header/">00000000-0000-0000-0000-0000
00000001</h:guid>

 

When I retrieve guid node and serialize it with guththila the XML I get
is:

<h:guid xmlns:h="http://localhost/namespce/header/"
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:mustUnderstand="1">00000000-0000-0000-0000-000000000001</h:guid>

 

I have a test program to show this behavior, if anyone would like to try
it out.

 

Is this a known bug or should I raise a JIRA for this?

 

I am stuck with using libxml2 since guththila seems to show some major
memory leaks in my application. Any insight to fix libxml wrapper so
that it outputs valid XML will be greatly appreciated.

 

Thank you!



---------------------------------------------------
Confidentiality Notice:  This electronic mail transmission is confidential, 
may be privileged and should be read or retained only by the intended
recipient.  If you have received this transmission in error, please
immediately notify the sender and delete it from your system.

Re: Building under windows

Posted by Nandika Jayawardana <ja...@gmail.com>.
If you have visual studio, it will be lot easier for you , if you
create a visual studio project and then use it to compile the code.

Regards
Nandika

On Mon, Aug 4, 2008 at 8:12 PM, Nikola Tankovć
<ni...@gmail.com> wrote:
> Ahh OK thank you, it works with gcc so I didn't think of that as a problem.
>
> Uthaiyashankar wrote:
>>
>> Hi,
>>
>> This error occurs if you declare any variables in the middle of the
>> method. You have to declare all the variables at the start of the method,
>> before other statements/implementations. In cgi_main.c you have declared a
>> variable conf_ctx in line 95, where line 67 - 91 you have other statements
>> (implementations). You have to move variable declaration to some lines
>> before 67.
>>
>> Regards,
>> Shankar
>>
>> Nikola Tankovć wrote:
>>>
>>> Hy all,
>>>
>>> I'm trying to build my CGI executable under windows using cl.exe but get
>>> the following errors
>>>
>>> cgi_main.c(95) : error C2275: 'axis2_conf_ctx_t' : illegal use of this
>>> type as an expression
>>>       C:\axis2c\include\axis2_conf_ctx.h(49) : see declaration of
>>> 'axis2_conf_ctx_t'
>>>
>>> ... and so on and on (similar errors)
>>>
>>> Obviously included locations are fine, maybe the problem is that I'm
>>> using MS Visual Studio 2008 so syntax is somewhat different for typdef? Or
>>> did I forget some specific flag?
>>>
>>> I'm using the command like this (as I saw in the makefile)
>>>
>>> cl.exe /D "_DEBUG" /Od /Z7 /MDd /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D
>>> "AXIS2_DECLARE_EXPORT" /D "_CRT_SECURE_NO_DEPRECATE" /D
>>> "_CRT_SECURE_NO_WARNINGS" /D "AXIS2_SVR_MULTI_THREADED" /W3 /wd4100  /MP10
>>> /nologo /I %AXIS2C_HOME%include /c cgi_main.c
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>

Re: Building under windows

Posted by Nikola Tankovć <ni...@gmail.com>.
Ahh OK thank you, it works with gcc so I didn't think of that as a problem.

Uthaiyashankar wrote:
>
> Hi,
>
> This error occurs if you declare any variables in the middle of the 
> method. You have to declare all the variables at the start of the 
> method, before other statements/implementations. In cgi_main.c you 
> have declared a variable conf_ctx in line 95, where line 67 - 91 you 
> have other statements (implementations). You have to move variable 
> declaration to some lines before 67.
>
> Regards,
> Shankar
>
> Nikola Tankovć wrote:
>> Hy all,
>>
>> I'm trying to build my CGI executable under windows using cl.exe but 
>> get the following errors
>>
>> cgi_main.c(95) : error C2275: 'axis2_conf_ctx_t' : illegal use of 
>> this type as an expression
>>        C:\axis2c\include\axis2_conf_ctx.h(49) : see declaration of 
>> 'axis2_conf_ctx_t'
>>
>> ... and so on and on (similar errors)
>>
>> Obviously included locations are fine, maybe the problem is that I'm 
>> using MS Visual Studio 2008 so syntax is somewhat different for 
>> typdef? Or did I forget some specific flag?
>>
>> I'm using the command like this (as I saw in the makefile)
>>
>> cl.exe /D "_DEBUG" /Od /Z7 /MDd /D "WIN32" /D "_WINDOWS" /D "_MBCS" 
>> /D "AXIS2_DECLARE_EXPORT" /D "_CRT_SECURE_NO_DEPRECATE" /D 
>> "_CRT_SECURE_NO_WARNINGS" /D "AXIS2_SVR_MULTI_THREADED" /W3 /wd4100  
>> /MP10 /nologo /I %AXIS2C_HOME%include /c cgi_main.c
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Building under windows

Posted by Uthaiyashankar <sh...@wso2.com>.
Hi,

This error occurs if you declare any variables in the middle of the 
method. You have to declare all the variables at the start of the 
method, before other statements/implementations. In cgi_main.c you have 
declared a variable conf_ctx in line 95, where line 67 - 91 you have 
other statements (implementations). You have to move variable 
declaration to some lines before 67.

Regards,
Shankar

Nikola Tankovć wrote:
> Hy all,
>
> I'm trying to build my CGI executable under windows using cl.exe but 
> get the following errors
>
> cgi_main.c(95) : error C2275: 'axis2_conf_ctx_t' : illegal use of this 
> type as an expression
>        C:\axis2c\include\axis2_conf_ctx.h(49) : see declaration of 
> 'axis2_conf_ctx_t'
>
> ... and so on and on (similar errors)
>
> Obviously included locations are fine, maybe the problem is that I'm 
> using MS Visual Studio 2008 so syntax is somewhat different for 
> typdef? Or did I forget some specific flag?
>
> I'm using the command like this (as I saw in the makefile)
>
> cl.exe /D "_DEBUG" /Od /Z7 /MDd /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D 
> "AXIS2_DECLARE_EXPORT" /D "_CRT_SECURE_NO_DEPRECATE" /D 
> "_CRT_SECURE_NO_WARNINGS" /D "AXIS2_SVR_MULTI_THREADED" /W3 /wd4100  
> /MP10 /nologo /I %AXIS2C_HOME%include /c cgi_main.c
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Building under windows

Posted by Nikola Tankovć <ni...@gmail.com>.
Hy all,

I'm trying to build my CGI executable under windows using cl.exe but get 
the following errors

cgi_main.c(95) : error C2275: 'axis2_conf_ctx_t' : illegal use of this 
type as an expression
        C:\axis2c\include\axis2_conf_ctx.h(49) : see declaration of 
'axis2_conf_ctx_t'

... and so on and on (similar errors)

Obviously included locations are fine, maybe the problem is that I'm 
using MS Visual Studio 2008 so syntax is somewhat different for typdef? 
Or did I forget some specific flag?

I'm using the command like this (as I saw in the makefile)

cl.exe /D "_DEBUG" /Od /Z7 /MDd /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D 
"AXIS2_DECLARE_EXPORT" /D "_CRT_SECURE_NO_DEPRECATE" /D 
"_CRT_SECURE_NO_WARNINGS" /D "AXIS2_SVR_MULTI_THREADED" /W3 /wd4100  
/MP10 /nologo /I %AXIS2C_HOME%include /c cgi_main.c


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


RE: axiom_node_serialize does not serialize namespaces properly

Posted by Hatim Daginawala <Ha...@argodata.com>.
Thanks Nandika that fixed the issue but axiom_node_serialize_sub_tree
causes a memory leaks.

Part of the memory leak is caused by the fix for issue 810 and part I
believe is caused by the other namespace hash table not being free
https://issues.apache.org/jira/browse/AXIS2C-810?page=com.atlassian.jira
.plugin.system.issuetabpanels:all-tabpanel

Solution doesn't look as simple as freeing the hash tables since that
causes traps.

I am attaching the test program I am using to test this, just in case if
anyone else wants to take a look.

Thanks
Hatim


-----Original Message-----
From: Nandika Jayawardana [mailto:jayawark@gmail.com] 
Sent: Thursday, July 31, 2008 11:33 PM
To: Apache AXIS C Developers List
Subject: Re: axiom_node_serialize does not serialize namespaces properly

Hi,
For efficiency reasons, axiom_node_serialize does not serialize all
the namespaces applicable to an element when the node is a sub element
of the axiom tree. Therefore you need to use
axiom_node_serialize_sub_tree method to properly serialize the sub
tree properly.

Regards
Nandika

On Thu, Jul 31, 2008 at 10:56 PM, Hatim Daginawala
<Ha...@argodata.com> wrote:
> Hi All,
>
>
>
> Here is the sample XML I am working with:
>
> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
>
>     <s:Header>
>
>         <h:guid s:mustUnderstand="1"
>
xmlns:h="http://localhost/namespce/header/">00000000-0000-0000-0000-0000
00000001</h:guid>
>
>     </s:Header>
>
>     <s:Body>
>
>         <EchoParm xmlns="http://localhost/namespce/body/">
>
>             <str>Response: Hello EchoEx</str>
>
>         </EchoParm>
>
>     </s:Body>
>
> </s:Envelope>
>
>
>
> When I retrieve guid node and serialize it with libxml2 the XML I get
is:
>
> <h:guid s:mustUnderstand="1"
>
xmlns:h="http://localhost/namespce/header/">00000000-0000-0000-0000-0000
00000001</h:guid>
>
>
>
> When I retrieve guid node and serialize it with guththila the XML I
get is:
>
> <h:guid xmlns:h="http://localhost/namespce/header/"
> xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
> s:mustUnderstand="1">00000000-0000-0000-0000-000000000001</h:guid>
>
>
>
> I have a test program to show this behavior, if anyone would like to
try it
> out.
>
>
>
> Is this a known bug or should I raise a JIRA for this?
>
>
>
> I am stuck with using libxml2 since guththila seems to show some major
> memory leaks in my application. Any insight to fix libxml wrapper so
that it
> outputs valid XML will be greatly appreciated.
>
>
>
> Thank you!
>
> ________________________________
> ---------------------------------------------------
> Confidentiality Notice: This electronic mail transmission is
confidential,
> may be privileged and should be read or retained only by the intended
> recipient. If you have received this transmission in error, please
> immediately notify the sender and delete it from your system.



-- 
http://nandikajayawardana.blogspot.com/
WSO2 Inc: http://www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org



---------------------------------------------------
Confidentiality Notice:  This electronic mail transmission is confidential, 
may be privileged and should be read or retained only by the intended
recipient.  If you have received this transmission in error, please
immediately notify the sender and delete it from your system.

Re: axiom_node_serialize does not serialize namespaces properly

Posted by Nandika Jayawardana <ja...@gmail.com>.
Hi,
For efficiency reasons, axiom_node_serialize does not serialize all
the namespaces applicable to an element when the node is a sub element
of the axiom tree. Therefore you need to use
axiom_node_serialize_sub_tree method to properly serialize the sub
tree properly.

Regards
Nandika

On Thu, Jul 31, 2008 at 10:56 PM, Hatim Daginawala
<Ha...@argodata.com> wrote:
> Hi All,
>
>
>
> Here is the sample XML I am working with:
>
> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
>
>     <s:Header>
>
>         <h:guid s:mustUnderstand="1"
> xmlns:h="http://localhost/namespce/header/">00000000-0000-0000-0000-000000000001</h:guid>
>
>     </s:Header>
>
>     <s:Body>
>
>         <EchoParm xmlns="http://localhost/namespce/body/">
>
>             <str>Response: Hello EchoEx</str>
>
>         </EchoParm>
>
>     </s:Body>
>
> </s:Envelope>
>
>
>
> When I retrieve guid node and serialize it with libxml2 the XML I get is:
>
> <h:guid s:mustUnderstand="1"
> xmlns:h="http://localhost/namespce/header/">00000000-0000-0000-0000-000000000001</h:guid>
>
>
>
> When I retrieve guid node and serialize it with guththila the XML I get is:
>
> <h:guid xmlns:h="http://localhost/namespce/header/"
> xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
> s:mustUnderstand="1">00000000-0000-0000-0000-000000000001</h:guid>
>
>
>
> I have a test program to show this behavior, if anyone would like to try it
> out.
>
>
>
> Is this a known bug or should I raise a JIRA for this?
>
>
>
> I am stuck with using libxml2 since guththila seems to show some major
> memory leaks in my application. Any insight to fix libxml wrapper so that it
> outputs valid XML will be greatly appreciated.
>
>
>
> Thank you!
>
> ________________________________
> ---------------------------------------------------
> Confidentiality Notice: This electronic mail transmission is confidential,
> may be privileged and should be read or retained only by the intended
> recipient. If you have received this transmission in error, please
> immediately notify the sender and delete it from your system.



-- 
http://nandikajayawardana.blogspot.com/
WSO2 Inc: http://www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org