| home / programming / java / webservices / chap3 / 4 | [previous] [next] |
|
According to the SOAP specification, information can only be transmitted between a sender and receiver via XML. This means that Java types cannot be exchanged without being serialized to/deserialized from XML.
Apache SOAP uses type mappings to determine how Java types should be serialized to/deserialized from
XML. Type mappings are implemented using a Java class, with the default type mapping class being
org.apache.soap.encoding.SOAPMappingRegistry. This class contains type mappings for primitive
Java types, wrapper classes for primitive Java types, and some other useful types that we will discuss
in the next section. If we want to transmit user-defined types from an Apache SOAP server we have to
override the SOAPMappingRegistry class so that the new type is included. We will discuss
how to register user defined types from an Apache SOAP client in the
Developing SOAP Clients section. Type mapping can also be defined using a deployment descriptor,
which will be discussed in an upcoming section.
Each type mapping contains the following information:
Apache SOAP provides support for three encoding styles: SOAP, Literal XML, and XMI.
As discussed in Chapter 2, the SOAP specification recommends that SOAP encoding be used, but other
encoding styles may be defined and used. Apache SOAP provides support for the SOAP encoding style,
which is identified by the http://schemas.xmlsoap.org/soap/encoding/ Uniform Resource
Identifier (URI), which defines the schema for the encoding style. This encoding style defines a type
system that is very similar to programming languages.
Apache SOAP also provides support for the literal XML encoding style. The literal XML encoding style allows DOM XML elements to be included as parameters and returned from an RPC method call. This encoding style is useful if wanting to send and receive XML documents.
XML Metadata Interchange (XMI) provides a way to interchange object-oriented models and data using XML. XMI is a standard from the OMG (Object Management Group). A number of companies are in the process of supporting the XMI specification or already provide support in one or more of their products such as TogetherSoft and Rational Rose. To illustrate how XMI might be useful let's look at a scenario that consist of two software development firms that are collaborating on developing a large-scale enterprise product. Let's refer to the companies as Company A and Company B. Company A uses TogetherSoft to model part of the project, whereas Company B uses Rational Rose to model another part of the project. This makes it very difficult to collaborate since the models are stored in a proprietary fashion. However, if TogetherSoft and Rational Rose both support XMI then the model could be exchanged with out having to worry about incompatibility issues. More information about XMI can be found at http://www.omg.org/technology/documents/formal/xmi.htm.
| home / programming / java / webservices / chap3 / 4 | [previous] [next] |
Created: June 5, 2002
Revised: June 5, 2002
URL: http://webreference.com/programming/java/webservices/chap3/4/3.html