Hi!
Are you developing the web service by writing the code first or do you write the WSDL first?
I suspect the former, so I will answer that here. If you indeed are doing WSDL-first development, then go directly for the XML schema below.
You can use a
Java Bean class of your own as parameter or return type in a method that is exposed in your web service.
JAXB, the framework responsible for converting data from a Java object hierarchy to a XML representation, will take care of the mapping.
Example:
I implemented the following class to use as the type of a parameter sent to an operation in my web service:
Having deployed the web service, the following XML schema fragment was generated corresponding to the above class:
A SOAP request to the operation looks like this:
Best wishes!