| ILOG JRules User Guide > Integrating Application Data > Reference > Mapping Between Web Service Data and Dynamic Classes > Schema Type Mapping |
Schema Type Mapping |
PREVIOUS NEXT |
SOAP message instances are partially described by an operation name and a list of parameter values. There are two types of data parameter: simple and complex.
| Note |
| The use of WSDL files in the XOM is now deprecated. We recommend you use the JAX-WS API instead. |
A simple type parameter is mapped on a primitive or Java object instance. This mapping is defined by the JAX-RPC type mapping registry, and the default type mapping policy. The JAX-RPC supported types are built-in types, including:
int, Integer).
String, Date, Calendar, BigInteger, BigDecimal, and QName.
<element name="elem1" type="int"/> is mapped on an int Java type, although <element name="elem1" type="int" nillable="true"/> is mapped on Integer.
The following tables are a reproduction of the JAX-RPC mapping tables, which specifies the Java mapping for the built-in simple XML data types and the SOAP encoded simple types.
A complex type parameter is mapped on an IlrXmlObject instance. The XML attributes and elements of the complex type are mapped on Java fields of the instance. The mapping is very similar to the XML binding of XML schema complex types. (See the XML Binding User's Manual: Mapping Schema Components to Dynamic Classes.)
A XOM is generated from the XSD schema part of a WSDL document. The dynamic classes related to the XML complex type are then made available in the XOM, which is accessible to the business rules.
The proper use of holder classes is described in section 4.3.5 of the JAX-RPC 1.0 specification. Go to http://java.sun.com/xml/downloads/jaxrpc.html to view a copy of the specification. Java holder classes enable methods to return multiple output values. If you want a Web service operation to return multiple values, define the data type of the return value to be a complex type, such as an object with multiple parts or an array. Alternatively, specify that one or more of the Web service operation parameters be out or in-out parameters.
The following example shows a holder object for the String class:
public class StringHolder {
public String value;
public StringHolder() {
value = null;
}
public StringHolder(String v) {
value = v;
}
}
Given this class definition, you can write the following server code:
public int myMethod(StringHolder out) {
out.value = "Some String";
return 1;
}
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |