You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ted Jones <Tj...@metamatrix.com> on 2006/01/01 19:45:48 UTC
Objectify XML Nodes
I have an XML document that I need to convert to Axis objects. The XML
nodes will make-up the SOAPBody. Here's an example of what an XML
document might look like:
-------------
<?xml version="1.0" encoding="UTF-8"?><BooksNS:bookCollection
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:BooksNS="http://www.metamatrix.com/XMLSchema/DataSets/Books"
xmlns:BookTypesNS="http://www.metamatrix.com/XMLSchema/DataSets/Books/Bo
okDatatypes"><book
isbn="0-201-10088-6"><title>Compilers</title><subtitle>Principles,
Techniques, and
Tools</subtitle><edition>1</edition><authors><author>Aho</author><author
>Sethi</author><author>Ullman</author></authors><publishingInformation><
publisher>Addison-Wesley</publisher><publishDate>1985</publishDate></pub
lishingInformation></book></BooksNS:bookCollection>
--------------
I will strip off the top XML node and the SOAPBody will contain the rest
of the document. Are there any Axis utilities (or third party tools) to
accomplish this? I would prefer to avoid parsing the document or using
JDom to walk the nodes if at all possible.
Thanks,
Ted Jones
Re: Objectify XML Nodes
Posted by Anne Thomas Manes <at...@gmail.com>.
Define a schema for this XML document, import the schema into your WSDL, and
run wsdl2java. It will generate the Java objects that map to the XML.
Anne
On 1/1/06, Ted Jones <Tj...@metamatrix.com> wrote:
>
> I have an XML document that I need to convert to Axis objects. The XML
> nodes will make-up the SOAPBody. Here's an example of what an XML document
> might look like:
>
> -------------
> <?xml version="1.0" encoding="UTF-8"?><BooksNS:bookCollection xmlns:xsd="
> http://www.w3.org/2001/XMLSchema" xmlns:BooksNS="
> http://www.metamatrix.com/XMLSchema/DataSets/Books" xmlns:BookTypesNS="
> http://www.metamatrix.com/XMLSchema/DataSets/Books/BookDatatypes"><book<http://www.metamatrix.com/XMLSchema/DataSets/Books/BookDatatypes%22%3E%3Cbook>isbn="0-201-10088-6"><title>Compilers</title><subtitle>Principles,
> Techniques, and
> Tools</subtitle><edition>1</edition><authors><author>Aho</author><author>Sethi</author><author>Ullman</author></authors><publishingInformation><publisher>Addison-Wesley</publisher><publishDate>1985</publishDate></publishingInformation></book></BooksNS:bookCollection>
> --------------
>
> I will strip off the top XML node and the SOAPBody will contain the rest
> of the document. Are there any Axis utilities (or third party tools) to
> accomplish this? I would prefer to avoid parsing the document or using JDom
> to walk the nodes if at all possible.
>
> Thanks,
> Ted Jones
>