Home
TOC Index |
Types Supported By JAX-RPC
Behind the scenes, JAX-RPC maps types of the Java programming language to XML/WSDL definitions. For example, JAX-RPC maps the
java.lang.String
class to thexsd:string
XML data type. Application developers don't need to know the details of these mappings, but they should be aware that not every class in the Java 2 Standard Edition (J2SE) can be used as a method parameter or return type in JAX-RPC.J2SE SDK Classes
JAX-RPC supports the following J2SE SDK classes:
java.lang.Boolean java.lang.Byte java.lang.Double java.lang.Float java.lang.Integer java.lang.Long java.lang.Short java.lang.String java.math.BigDecimal java.math.BigInteger java.util.Calendar java.util.DateThis release of JAX-RPC also supports several implementation classes of the
java.util.Collection
interface. See Table 9-2.Primitives
JAX-RPC supports the following primitive types of the Java programming language:
boolean byte double float int long shortArrays
JAX-RPC also supports arrays with members of supported JAX-RPC types. Examples of supported arrays are
int[]
andString[]
. Multidimensional arrays, such asBigDecimal[][]
, are also supported.Application Classes
JAX-RPC also supports classes that you've written for your applications. In an order processing application, for example, you might provide classes named
Order
,LineItem
, andProduct
. The JAX-RPC Specification refers to such classes as value types, because their values (or states) may be passed between clients and remote services as method parameters or return values.To be supported by JAX-RPC, an application class must conform to the following rules:
- It must have a public default constructor.
- It must not implement (either directly or indirectly) the
java.rmi.Remote
interface.- Its fields must be supported JAX-RPC types.
The class may contain public, private, or protected fields. For its value to be passed (or returned) during a remote call, a field must meet these requirements:
- A public field cannot be final or transient.
- A non-public field must have corresponding getter and setter methods.
JavaBeans Components
JAX-RPC also supports JavaBeans components, which must conform to the same set of rules as application classes. In addition, a JavaBeans component must have a getter and setter method for each bean property. The type of the bean property must be a supported JAX-RPC type. For an example of a JavaBeans component, see the section JAX-RPC Distributor Service.
Home
TOC Index |
This tutorial contains information on the 1.0 version of the Java Web Services Developer Pack.
All of the material in The Java Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.