users@jax-rpc.java.net

Re: JAXRPC and JAXB generated classes

From: Doug Kohlert <doug.kohlert_at_sun.com>
Date: Mon, 07 Jul 2003 10:02:31 -0700

Matthew,
JAXRPC 2.0 and JAXB 2.0 will align with each other. You can read
the JSR for more details. It is located at:
http://www.jcp.org/en/jsr/detail?id=224

Matthew Laurenson wrote:
> Hi,
>
> 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:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:tns="http://www.agmodel.net/SpatialSchema"
> elementFormDefault="qualified"
> targetNamespace="http://www.agmodel.net/SpatialSchema">
>
> <xs:complexType name="Location2D">
> <xs:sequence>
> <xs:element name="latitude" type="xs:double" />
> <xs:element name="longitude" type="xs:double" />
> </xs:sequence>
> </xs:complexType>
> ...
>
> </xs:schema>
>
> 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
> do.
>
> Regards
> Matthew Laurenson
> National Agriculture Research Center
> Japan


-- 
Doug Kohlert
Java Software Division
Sun Microsystems, Inc.
phone: 503 345-9806