I am not sure how your web service is implemented. Maybe this will help. I am using the SAAJ api. In my case the soap body simply contains a complete xml document that is written against a preexisting schema. I create the document using the XmlBeans code I complied against my preexisting schema. I then add the document to the SOAPBody using the SAAJ api and the XmlBeans getDomNode() method to get the root node of my document. Here is the code I am using:
// get the SOAPBody and add the result xbean document. SOAPMessage message = messageFactory.createMessage(); SOAPBody body = message.getSOAPBody(); Node node = xbeanDoc.getXXX().getDomNode(); // where XXX is the rot element name Document doc = node.getOwnerDocument(); bodyElement = body.addDocument(doc); Hope that helps, Jon ============================================ Jonathan O. Baker The MITRE Corporation Email: [EMAIL PROTECTED] >-----Original Message----- >From: Harring Figueiredo [mailto:[EMAIL PROTECTED] >Sent: Tuesday, June 19, 2007 11:51 AM >To: [email protected] >Subject: Writing the XML Object to a SOAP envelope. > > >Hello All, > >How can I write the XML document to the envelope of another >XML (say Soap) as the body content? > >If I do an object.toString(), the XML is not escaped. > >Thank you for any help. > >harringf > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

