SAAJ : Problems when adding values
----------------------------------

                 Key: AXIS2-3240
                 URL: https://issues.apache.org/jira/browse/AXIS2-3240
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
    Affects Versions: 1.3
            Reporter: Lorenzo


When i edit an element (now adding childs to Header) seems that
something go wrong when i add values..

For example:
-----------------------------------------------
CODE:
-----------------------------------------------

Name name = new PrefixedQName("http://myNS","lName","prefix";);
SOAPFactoryImpl sf = new SOAPFactoryImpl();
SOAPElementImpl myEle = (SOAPElementImpl) sf.createElement(name1);

SOAPElementImpl child1 = 
        (SOAPElementImpl)myEle.addChildElement("child1");

SOAPElementImpl child1_1 =
        (SOAPElementImpl)child1.addChildElement("child1_1");

SOAPElementImpl child2 = 
        (SOAPElementImpl) myEle.addChildElement("child2");

SOAPElementImpl child2_1 = 
        (SOAPElementImpl) child2.addChildElement("child2_1");
        
System.out.println("O -> " + XMLUtils.toOM(myEle));

child2_1.setValue("AAAA");

System.out.println("A -> " + XMLUtils.toOM(myEle));

child1_1.setValue("BBBB");

System.out.println("B -> " + XMLUtils.toOM(myEle));
                        
myEle.addChildElement("NEW");
child2.addChildElement("NEW");
child1.addChildElement("NEW");

System.out.println("N -> " + XMLUtils.toOM(myEle));


-----------------------------------------------
OUTPUT:
-----------------------------------------------

16:06:30,669 INFO  [STDOUT] O -> <prefix:lName
xmlns:prefix="http://myNS";><child1><child1_1 /></child1><child2><child2_1 
/></child2></prefix:lName>

16:06:30,672 INFO  [STDOUT] A -> <prefix:lName
xmlns:prefix="http://myNS";><child1><child1_1 
/></child1><child2><child2_1>AAAA</child2_1></child2></prefix:lName>

16:06:30,674 INFO  [STDOUT] B -> <prefix:lName
xmlns:prefix="http://myNS";><child1><child1_1>BBBB</child1_1></child1></prefix:lName>

16:06:30,677 INFO  [STDOUT] N -> <prefix:lName
xmlns:prefix="http://myNS";><child1><child1_1>BBBB</child1_1></child1></prefix:lName>

------------------------------------------------

If i make:
Iterator itr = myEle.getChildElements();
while(itr.hasNext()){
 log.info(XMLUtils.toOM((SOAPElementImpl) itr.next()));
} 

i can iterate in all childs but they are affected by the same problem...
Same when i writeTo the SOAPMessage (all new nodes missed eccept the
first one)




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to