The javax.xml.rpc.encoding package contains the classes and
interfaces that form the portable part of the
serialization
framework used to convert between Java language types and XML
messages. Although the rules for mapping between these two
representations are well-defined by the JAX-RPC specification, only a
minimal interface to the serialization framework is defined, leaving
most of the details to be determined by vendors that implement the
specification. This has two consequences:
Although a minimal serialization interface is defined, it is far from
sufficient to allow developers to create their own serializers that
would work across different JAX-RPC implementations. Serializer
portability was not an aim of the JAX-RPC 1.0 specification.
Although the JAX-RPC reference implementation contains a
serialization framework, it is not part of the public API and there
is no documentation available for it. Therefore, in practice, even if
you don't mind the fact that your custom serializers
will be nonportable, it is very difficult to even get started writing
one. Furthermore, the nonpublic nature of the API means that
incompatible changes may be made at any time, which may cause your
serializers to stop working.
As a result, this book does not describe how to write custom
serializers, and this chapter documents only the minimal public API.
The XMLType class defines constants that represent
various XML Schema and SOAP data types. This class is probably the
only one in this package that application developers will be likely
to use. The TypeMappingRegistry and
TypeMapping interfaces provide groupings of
serializers for specific XML data types using one or more encoding
schemes. The serializers themselves implement the
Serializer and Deserializer
interfaces, which, at least in the current version of the
specification, are marker interfaces that define no methods.
Serializers are obtained from a SerializerFactory
or a DeserializerFactory, and use instances of the
SerializationContext and
DeserializationContext interfaces to maintain
state during the serialization or deserialization of a message.