axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roshan Weerasuriya (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Commented: (AXISCPP-353) BasicNode->setValue does not set a new value but appends to any current value
Date Wed, 02 Feb 2005 06:02:19 GMT
     [ http://issues.apache.org/jira/browse/AXISCPP-353?page=comments#action_58488 ]
     
Roshan Weerasuriya commented on AXISCPP-353:
--------------------------------------------

hi Andrew,

I investigated this issue. The reason for why you see (or get) it as a appended text is described
below. You create the "pIHeaderBlock2" by cloning "pIHeaderBlock". By the time you clone "pIHeaderBlock"
it already has a a ChildNode in it. Therefore "pIHeaderBlock2" will also contain this text
child. Now when you create the text child in "pIHeaderBlock2" (which already has a child because
it was cloned from "pIHeaderBlock") it will contain this new text child plus the previous
cloned child. So when Axis C++ serialize the "pIHeaderBlock2" you will see this out put. So
I think there is not a bug. 

Any comments?

Roshan

> BasicNode->setValue does not set a new value but appends to any current value
> -----------------------------------------------------------------------------
>
>          Key: AXISCPP-353
>          URL: http://issues.apache.org/jira/browse/AXISCPP-353
>      Project: Axis-C++
>         Type: Bug
>   Components: Basic Architecture
>     Reporter: Andrew Perry
>     Assignee: Roshan Weerasuriya

>
> In a handler I am creating a HeaderBlock, creating a child character node, setting a
value into the new node and adding the new node to the headerblock. I then clone the headerblock
and reset the localname and uri, but when trying to set a new value it appends it to the value
of the character node set in the first header block rather than setting it to the new value.
> ------ code snippit -----
>         IHandlerSoapSerializer* pISZ;
>         pIMsg->getSoapSerializer(&pISZ);
>         IHeaderBlock* pIHeaderBlock = pISZ->createHeaderBlock("ahb", "http://soapinterop.org/axis/");
>         BasicNode* pBasicNode = pIHeaderBlock->createChild(CHARACTER_NODE);
>         pBasicNode->setValue("This is a test");
>         pIHeaderBlock->addChild(pBasicNode);
>         IHeaderBlock* pIHeaderBlock2 = pIHeaderBlock->clone();
>         pIHeaderBlock2->setLocalName("ahb2");
>         pIHeaderBlock2->setUri("http://soapinterop.org/axis2/");
>         BasicNode* pBasicNode2 = pIHeaderBlock2->createChild(CHARACTER_NODE);
>         pBasicNode2->setValue("Test2");
>         pIHeaderBlock2->addChild(pBasicNode2);
>         pISZ->addHeaderBlock(pIHeaderBlock2);
> -------------------------
> This creates the following SOAP header
> <SOAP-ENV:Header><ns2:ahb xmlns:ns2="http://soapinterop.org/axis/">This is
a test</ns2:ahb><ns3:ahb2 xmlns:ns3="http://soapinterop.org/axis2/">This is a
testTest2</ns3:ahb2></SOAP-ENV:Header>
> setValue should set the value of the node to the specified value and not append it, i.e.
it should set the value of ahb2 to 'Test2' and not append 'Test2' to 'This is a test'

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message