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.
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.