This looks like avoiding the problem instead of solving it (which works fine of course)?
It looks to me that the getAsDocument() method sh/could be called in the serializer, not in the web service itself.
remko
Huaming Liu wrote:
I remember someone has got a problem when he wants to implement this kind of method "public void method(Document, req, Document resp)". So I'd like to reply: ----- If you want to get the whole XML document, the last one of the four types of Axis message-style methods can help: public void methodName(SOAPEnvelope req, SOAPEnvelope resp).
What you need to do is to transform between SOAPEnvelope and Document. I've tried this:
public static SOAPEnvelope getSOAPFromDocument(Document doc) throws Exception { DOMSource source = new DOMSource(doc); MessageFactory mf = MessageFactory.newInstance(); SOAPMessage message = mf.createMessage(); SOAPPart soapPart= message.getSOAPPart(); soapPart.setContent(source); SOAPEnvelope soapEnv = (SOAPEnvelope)soapPart.getEnvelope(); return soapEnv; }
To get Document from SOAPEnvelope, call org.apache.axis.message.SOAPEnvelope.getAsDocument() ------