[ 
https://issues.apache.org/jira/browse/AXIOM-465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14227681#comment-14227681
 ] 

Jayashankar commented on AXIOM-465:
-----------------------------------

Hi,

SOAPHeaderBlock headerBlock =  
soapHeader.addHeaderBlock(builder.getDocumentElement().getLocalName(),builder.getDocumentElement().getNamespace());
      java.util.Iterator attributeItr = 
builder.getDocumentElement().getAllAttributes();
      if (headerBlock !=null){
         while (attributeItr.hasNext()){
              headerBlock.addAttribute((OMAttribute) attributeItr.next());
         }
      }
      java.util.Iterator childItr = builder.getDocumentElement().getChildren();
      if (headerBlock !=null) {
         while (childItr.hasNext()){
             OMNode node = (OMNode) childItr.next(); 
                  if(node instanceof OMText)
                        continue;
                  headerBlock.addChild(node);                     
         }
      }      
 this is the code to generate header block. 

Looks like issue is with addChild() not in hasNext() / next()


> Axiom not adding child elements in soap header.
> -----------------------------------------------
>
>                 Key: AXIOM-465
>                 URL: https://issues.apache.org/jira/browse/AXIOM-465
>             Project: Axiom
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 1.2.13
>         Environment: Tomcat Java 6/7
>            Reporter: Jayashankar
>            Priority: Critical
>             Fix For: 1.2.13
>
>
> Axiom not honouring the sibling nodes. 
> Crazy stuff is happening in OMAbstractIterator.java in hasNext() and next() 
> methods. 
> Let me brief my issue further..
> I have an xml that needs to go as soap header which is as follows. 
> <ns2:serviceRequestContextHeader xmlns:ns1="http://common.***.***.com/"; 
> xmlns:ns2="http://ods.***.***.com/";>
> <ns1:messageId>0</ns1:messageId> 
> <ns1:requestorDN>****</ns1:requestorDN>
> </ns2:serviceRequestContextHeader> 
> When I sniff the soap envelope with a TCP Mon, the soap header is as follows.
> <soapenv:Header>
> <ns2:serviceRequestContextHeader xmlns:ns2="http://ods.**.***.com/";>
> <ns1:messageId xmlns:ns1="http://common.**.***.com/";>0</ns1:messageId>
> </ns2:serviceRequestContextHeader>
> </soapenv:Header>
> requestorDN is skipped. This used to work fine in Axiom 1.2.10



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to