axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sardar Hussain <salarzi_...@yahoo.com>
Subject RE: [AXIS2] SOAPENVELOPE Parsing
Date Tue, 01 Feb 2011 01:27:36 GMT
Thank you Yashwanth, but can you kindly look at the body parsing section please.

sardar

--- On Mon, 31/1/11, Yashwanth Rajaram -X (yrajaram - Zensar at Cisco) <yrajaram@cisco.com>
wrote:

From: Yashwanth Rajaram -X (yrajaram - Zensar at Cisco) <yrajaram@cisco.com>
Subject: RE: [AXIS2] SOAPENVELOPE Parsing
To: java-dev@axis.apache.org, axis-dev@ws.apache.org
Date: Monday, 31 January, 2011, 16:05




 
 






Sardar: 

   

I am not very sure but if I remember right to access the Header
elements you have to do : 

SOAPHeaderBlock element =  ElementHelper.toSOAPHeaderBlock((OMElement)
headerElements.next(),soapFactory);
// ie you can’t access as OMElement 

Then you can print using element.getText(); 

   

cheers, 

-- 

Yashwanth 

   



From: Sardar Hussain
[mailto:salarzi_qau@yahoo.com] 

Sent: Monday, January 31, 2011 1:06 PM

To: axis-dev@ws.apache.org

Subject: [AXIS2] SOAPENVELOPE Parsing 



   


 
  
  Hi,

  

  I am implementing a Handler where I need to catch and parse the SOAPEnvelope
  from the MssageContext, however I am getting problem with printing its nodes.

  

  My code as as follows:

  

  

  SOAPEnvelope env = messageContext.getEnvelope();

          

          

          Iterator bodyElements =
  env.getBody().getChildElements();

          Iterator headerElements =
  env.getHeader().getChildElements();

  

  while (bodyElements.hasNext()) {

  

              OMElement
  element = (OMElement) bodyElements.next();

             
  if(element.getText()!=null)

             
      System.out.println("Body Elements \n  " +
  element.getText());

  

              }

  

          while (headerElements.hasNext()){

  

              OMElement
  element = (OMElement) headerElements.next();

             
  if(element.getText()!=null)

             
      System.out.println("\n Header
  Elements\n"+element.getText());

               

         }

  

  When I print the SOAPEnvelope then I can print that and see however when I
  iterate them as above in the code then Its empty and don't display anything.

  

  Any clue plz?

  

  Sardar 
  
 


   



 




      
Mime
View raw message