Download PDF Home History |  | API Search Feedback FAQ

> ## 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 the `xsd: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 Platform, 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.net.URI

>     java.util.Calendar
>     java.util.Date

> ### Primitives

> JAX-RPC supports the following primitive types of the Java programming language:

>     boolean
>     byte
>     double
>     float
>     int
>     long
>     short

> ### Arrays

> JAX-RPC also supports arrays that have members of supported JAX-RPC types. Examples of supported arrays are `int[]` and `String[]`. Multidimensional arrays, such as `BigDecimal[][]`, are also supported.

> ### Value Types

> A value type is a class whose state can be passed between a client and a remote service as a method parameter or return value. For example, in an application for a university library, a client might call a remote procedure with a value type parameter named `Book`, a class that contains the fields `Title`, `Author`, and `Publisher`.

> To be supported by JAX-RPC, a value type 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 value type can contain public, private, or protected fields. The field of a value type must meet these requirements:

> - A public field cannot be final or transient.
> - A nonpublic 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 a setter method for each bean property. The type of the bean property must be a supported JAX-RPC type. For an example of using a JavaBeans component in a Web service, see JAX-RPC Coffee Supplier Service.

Download PDF Home History |  | API Search Feedback FAQ

All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.