Hi Mark--

>If I extract the Document in my web service like
>
>SOAPBodyElement sbe = input[0];
>Element elem = sbe;
>NodeList list = elem.getElementsByTagName ("field");
>...
>
>it should work, right?

Actually, it's odd; on the server end, Axis gives you a java.util.Vector of 
DOM Elements rather than an array of SOAPBodyElements.  So, your service 
would be a class with a method like the following:

public Element[] process(Vector elems){
   //process stuff in here and return an array of DOM Elements
}

Expose this method via your .wsdd file (again, see the "message" service in 
the Axis examples), and when you send a request to the address of this 
service, the process() method (or whatever you name it) will get called.

>By the way, I am an german intern and in the US since march this year.
>Thanks for your support!

You're welcome.  I noticed, upon re-reading the paragraph below, that I 
sent you a very confusing sentence fragment.  I should learn to proofread.

Andrew

> >Mark,
> >
> >I suggest you do the following:
> >
> >parse the XML document.  Use the DOM Document.getDocumentElement() method
> >to get the document element of the document.  Create a SOAPBodyElement from
> >this DOM Element.  Invoke the service with an array containing only this
> >SOAPBodyElement.  On the wire, you can look at this SOAP Envelope and see
> >that your entire XML document, minus the xml declaration and any comments,
> >etc. you had outside the document's root element.  Assuming you can afford
> >to lose these things, it's easy to write a service that extracts the whole
> >DOM on the other end (again, see the axis message example).  Here is some
> >client code that I'm using to do the same thing:
> >
> >      // parse document into Document object parsedDoc
> >
> >      SOAPBodyElement[] input = new SOAPBodyElement[1];
> >
> >      Element bodyElement = parsedDoc.getDocumentElement();
> >      SOAPBodyElement sbe = new SOAPBodyElement(bodyElement);
> >      sbe.setNamespaceURI("");
> >      input[0] = sbe;
> >
> >      Vector          elems = (Vector) call.invoke( input );
> >
> >
> >Andrew



Reply via email to