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 Nandika Jayawardana <ja...@gmail.com> on 2008/08/01 06:33:00 UTC

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-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


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.