The WSDL–XSD Relationship

Oracle JCA Adapter for Database 9-93

9.7.3.3 Oracle Data Types

Many primitive data types have well-defined mappings and therefore are supported by both the design-time and run-time components. In addition, you can use user-defined types such as VARRAY, nested tables, and OBJECT. Table 9–17 lists the supported data types for Oracle stored procedures and functions.

9.7.3.4 Generated XSD Attributes

Table 9–18 lists the attributes used in the generated XSDs. Note: Non-managed connection details are not created in the DBAdapter.jca files when you start JDeveloper in the normal mode. However, non-managed connection details are created in the DBAdapter .jca files when you start JDeveloper in the preview mode. Table 9–17 Data Types for Oracle Stored Procedures and Functions SQL or PLSQL Type XML Schema Type BINARY_DOUBLE DOUBLE PRECISION double BINARY_FLOAT FLOAT REAL float BINARY_INTEGER INTEGER PLS_INTEGER SMALLINT int BLOB LONG RAW RAW base64Binary CHAR CLOB LONG STRING VARCHAR2 string DATE TIMESTAMP TIMESTAMP WITH TIME ZONE dateTime DECIMAL NUMBER decimal Table 9–18 Generated XSD Attributes Attribute Example Purpose name name=param Name of an element type type=string XML schema type 9-94 Oracle Fusion Middleware Users Guide for Technology Adapters The db namespace is used to distinguish attributes used during run time from standard XML schema attributes. The db:type attribute is used to indicate what the database type is so that a suitable JDBC type mapping can be obtained at run time. The db:index attribute is used as an optimization by both the design-time and run-time components to ensure that the parameters are arranged in the proper order. Parameter indexes begin at 1 for procedures and 0 for functions. The return value of a function is represented as an OutputParameter element whose name is the name of the function and whose db:index is 0. The db:default attribute is used to indicate whether or not a parameter has a default clause. The minOccurs value is set to 0 to allow for an IN parameter to be removed from the XML file. This is useful when a parameter has a default clause defining a value for the parameter for example, X IN INTEGER DEFAULT 0. At run time, if no element is specified for the parameter in the XML file, the parameter is omitted from the invocation of the stored procedure, thus allowing the default value to be used. Each parameter can appear at most once in the invocation of a stored procedure or function. Therefore, maxOccurs, whose default value is always 1, is always omitted from elements representing parameters. The nillable attribute is always set to true to allow the corresponding element in the instance XML to have a null value for example, X or XX. In some cases, however, to pass an element such as this, which does have a null value, you must state this explicitly for example, X xsi:nil=true. The namespace, xsi, used for the nillable attribute, must be declared explicitly in the instance XML for example, xmlns:xsi= http:www.w3.org2001XMLSchema -instance.

9.7.3.5 User-Defined Types

The Adapter Configuration Wizard can also generate valid definitions for user-defined types such as collections VARRAY and nested tables and OBJECT. These are created as complexType definitions in the XSD file. For VARRAY, the complexType definition defines a single element in its sequence, called name_ITEM, where name is the name of the VARRAY element. All array elements in the XML file are so named. Given the following VARRAY type definition, SQL CREATE TYPE FOO AS VARRAY 5 OF VARCHAR2 10; and a VARRAY element, X, whose type is FOO, the following complexType is generated: complexType name=FOO sequence element name=X_ITEM db:type=VARCHAR2 minOccurs=0 maxOccurs=5 nillable=true simpleType db:type db:type=VARCHAR2 SQL or PLSQL type db:index db:index=1 Position of a parameter db:default db:default=true Has a default clause minOccurs minOccurs=0 Minimum occurrences maxOccurs maxOccurs=1 Maximum occurrences nillable nillable=true Permits null values Table 9–18 Cont. Generated XSD Attributes Attribute Example Purpose