JAXRPC and JAXB generated classes

From: Matthew Laurenson <matthewl_at_NARO.AFFRC.GO.JP>
Date: Mon, 30 Jun 2003 16:54:56 +0900


I have some XML Schema that I am using for both a JAXB-based
configuration file setup and also within the WSDL describing a JAX-RPC
Web service.

Here is part of the schema.
<?xml version="1.0" encoding="UTF-8"?>

   <xs:complexType name="Location2D">
      <xs:element name="latitude" type="xs:double" />
      <xs:element name="longitude" type="xs:double" />


JAXB generates a interface "Location2D" and an implementation
(*impl.Location2DImpl), but JAXRPC generates a class Location2D.

My understanding of the JAXRPC spec is that I couldn't use the JAXB
generated Location2D interface as a parameter in my RPC Remote
interface, neither could I have a JAXB Location2D reference within any
object used as a parameter.

I would like to map the JAXB and JAXRPC generated Location2Ds to an
immutable Location2D of my own. At present I plan to keep the two
children in separate packages and write a mapToImmutable and
unmapFromImmutable method for each. I wondered, however, whether there
were any thoughts of aligning JAXB and JAXRPC a little closer. To the
layman there would seem to be considerable overlap in the work they must

Matthew Laurenson
National Agriculture Research Center