You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by vanniarajan arumugam <va...@yahoo.com> on 2006/12/08 01:01:59 UTC

getting an document object from SOAPEnvelope

Hello, 
This is how invoke a web service 
Service service = new Service(); 
service.setMaintainSession(true); 
Call call = (Call)service.createCall(); 
SOAPEnvelope env = new SOAPEnvelope(call.getMessageContext().getSOAPConstants(), 
call.getMessageContext().getSchemaVersion()); 
env.addBodyElement(new SOAPBodyElement(intId)); 
env = call.invoke(env);         
                        
after that I am getting the expected result ...as follows 

<?xml version="1.0" encoding="UTF-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext"> 
        <soap:Body> 
                <Response xmlns="http://webservices.tesr.com/ity"> 
                        <response>                                         
                                <Header> 
                                        <TransactionId>14431654-205186AAA</TransactionId> 
                                        <QueId>20061211AAA</QueId> 
                                        <Status>0</Status> 
                                </Header> 
                        </response> 
                </Response> 
        </soap:Body> 
</soap:Envelope> 
Now I need to add a new element inside soap.Body     
<Requester> 
        Raj CMSS 
</Requester>   
  so my final document should look like 
<?xml version="1.0" encoding="UTF-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext"> 
        <soap:Body>                             
                <Response xmlns="http://webservices.tesr.com/ity"> 
                                                <Requester> 
                                 Raj CMSS 
                                 </Requester>                               
                        <response>                                         
                                <Header> 
                                        <TransactionId>14431654-205186AAA</TransactionId> 
                                        <QueId>20061211AAA</QueId> 
                                        <Status>0</Status> 
                                </Header> 
                        </response> 
                </Response> 
        </soap:Body> 
</soap:Envelope> 


I tried to get the document object  from my soap envelope   env  (SOAPEnvelope).. so I can add the needed element inside the soap.Body  but I am not able to do. 

I tried 
org.w3c.dom.Document  documentresponse = env.getAsDocument(); 
I am not sure why I am not able to get the document object out of my soap envelope or If I am going in the right direction. 
Please shed some light. 

Thanks in advance 

Raj Arumugam
614-422-5689 (w)   614-218-5284 (c)
"Our lives become beautiful not because we are perfect. Our lives become beautiful because we put our heart into what we are doing." - Sadhguru  Jaggi Vasudev 




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


This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.

Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org