Do you mean, how do you create a DOM Document in an AXIS service?
My condolences.
I am very sorry to hear that you will be doing DOM programming in Java.
;)
// DOM Stuff
import org.w3c.dom.Document;
import org.w3c.dom.Element;
// JAXP crap:
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
...
org.w3c.dom.Document
doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocumen
t();
// Insert the root element node
Element root = doc.createElementNS("urn:wombat.2005.03",
"DocumentOut");
doc.appendChild(root);
Element elt= doc.createElementNS("urn:whatever", "Something");
root.appendChild(elt);
// etc
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 02, 2005 3:15 AM
To: [email protected]
Subject: Axis Message Service Document myMethod(Document body)
Hi Group:
I want to use the Axis Message Service with the method signature
Document myMethod(Document body).
In general this works fine (I have Element[] myMethod(Element[]
working), but I have one question about the returned Document.
How do I create a new one, where I can set my own values. The example
only shows an echoing.
I do it this way (see below). But this is not properly working. Any
hints would be appreciated? Do I have to use SoapDocumentImpl, and if
yes, is there an example how to initialize this.
Thanks HorstWalter
>
> Document retDoc = null;
> try {
> String status = (exitStatus==0) ? "OK" : "FAILURE";
> SOAPBodyElement el = new SOAPBodyElement(XMLUtils.StringToElement
> ("urn:" + this.getClass().getName(), "status", status));
> retDoc = el.getOwnerDocument();
> } catch (Exception e) { System.err.println(e.toString()); } return
> retDoc;
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193