Why no existing Java type to existing XML schema binding support?

N

nrm

For implementing a resource-oriented Web service, it has been quite
difficult for me to bridge the gap between XML schemas defining the Web
service interface (providing resources) and a Java implementation.

The main reason for my complaint is that my three options (all
involving Java) are to:

1. design a schema and generate Java types from it - this generates
different classes for different representations of a resource
2. design Java types and generate schema from it - require different
classes for supporting different representations of a resource, or
alternatively produces a single representation of a resource
3. design Java types and design schema - require manual XML processing
and a ton of challenges deploying the service and obtaining a WSDL
describing the service

As example, imagine I had to generate two representations of an order
which looked like the following XML:
<order-summary>
<number>...</number>
<placed>...</placed>
<status>...</status>
<total currency="...">...</total>
</order-summary>

<order-detail>
<number>...</number>
<placed>...</placed>
<status>...</status>
<items>
<item>
<name>...</name>
<sku>...</sku>
<count>...</count>
<price>...</price>
</item>
...
</items>
<total currency="...">...</total>
</order-detail>

I don't know of a standardized technology or a customization technique
for a standardized technology that I can use to work with a single
Order Java type that can be (un)marshalled from/to an XML stream of
either of the two representations.

I don't think either JAX-RPC or JAXWS provides any standardized support
for taking over the XML processing. Am I missing something? Do I need
to perform more research? Or is there a fundamental reason why this is
a bad idea?

I hope this topic merits a reasonable discussion.

Nikunj.
 
J

James McGill

I hope this topic merits a reasonable discussion.

I just use Castor. It's not perfect, but it certainly takes me to a
place where I don't have the kind of complaints you raise in your
message.
 
R

Roedy Green

I just use Castor. It's not perfect, but it certainly takes me to a
place where I don't have the kind of complaints you raise in your
message.

tell us about why you like it and what it does.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top