axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Vardeman <>
Subject RE: object types for autom. serialization
Date Tue, 14 May 2002 19:10:57 GMT

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);
     input[0] = sbe;

     Vector          elems = (Vector) call.invoke( input );


At 11:57 AM 5/14/2002 -0700, you wrote:
>I'd like to write a webservice that receives a complete XML File in a SOAP
>Body and writes it into a database.
>What possibilities do I have to do this?
>I thought about parsing the XML Document into a DOM-Object and give it to
>the axis serializer in the client....on the web service side I would get a
>DOM-Object from the axis deserializer, which I can use for databases'
>writing operations.
>My problem now is, that I only know how to use axis' serializer/deserializer
>with String-objects, not with DOM-Objects (from class dom.Document).
>I don't want to create mappings or any additional stuff, I'd just like to
>use the standard object types from axis.
>Do you think that the only possibility is to pass the xml document as a huge
>Ps sorry about my bad English....still learning :)
>  -----Original Message-----
>From:   Andrew Vardeman []
>Sent:   Tuesday, May 14, 2002 11:45 AM
>Subject:        Re: object types for autom. serialization
>Do you have control of the client and the service?  It seems like the only
>part of a dom.Document you might want to pass that you couldn't pass
>literally is the <?xml version = "1.0"?> declaration, which would make the
>SOAP message invalid.  If this isn't a concern, why not just write a
>messaging client that sends the text representation of the whole DOM as the
>SOAPBody and extract the whole thing on the other end with a messaging
>At 11:19 AM 5/14/2002 -0700, you wrote:
> >Hi!
> >
> >Where can I find a documentation of data-/obejct- types axis' serializer
> >handle?
> >
> >Actually I am looking for a way to pass a complete parsed XML-Document from
> >a client to a web service through axis. It does not matter to me whether I
> >have to put it in an array first or whether I can pass it as DOM-Object
> >(dom.Document) as long as I can use the standard axis serializer/des. .
> >
> >Any solutions?
> >Thanks in advance!!!
> >Mark.

View raw message