Creating custom type mappings

This section describes how to use the WST development tool to create type mappings and associate a Web service with a type mapping.

StepsCreating a Web service type mapping

  1. Select File | New | Other | Sybase Web Services | Type Mapping.

  2. Follow the wizard instructions to create the type mapping. Table 3-2 describes the Web service type mapping properties.

Table 3-2: Web service type mapping wizard

Window

Property

Description

Type Mapping Classes Selection

Type Class

A user defined structure or Java class whose mapping to XML is not standard. For example java.sql or resultsets.

Serializer Class

The fully qualified name of the serialization class used to convert the new datatype to XML.

Deserializer Class

The fully qualified name of the deserialization class used to convert the serialized XML data into application data.

SerializerFactory Class

An instance of the serialization class.

DeserializerFactory Class

An instance of the deserializer class.

Type Mapping WSDL Definition

Use Web Service Target NameSpace as Type Mapping’s NameSpace

Each type mapping can have its own namespace or have the same namespace as the Web service’s target namespace. If this property is selected, then “Type Mapping Namespace” is disabled.

Type Mapping NameSpace

The type mapping namespace (if not using the Web service’s target namespace).

Local Part

The local part of a qualified name (QName) which consists of a namespace plus “:” plus a local part serves as a pointer to a WSDL definition part.

Encoding Style

The encoding style used by the XML parser to apply when transforming a SOAP message to a Java object. Use “SOAP” unless you have defined an alternative encoding style for this class.

Store the Created Type Mapping to Local Store

Select Local Store or Create New Store

You can select an existing store for this type mapping or create a new one. Normally, a type mapping store consists of a description file and a list of JAR files. The description file contains the information of the first two windows, the JAR contains the serializer, deserializer, serializer factory, and deserializer factory classes. You can select “Sybase Web Service View,” and select type mappings to import them into the desired local store.

Undefined Type Mapping Found in Class

Please Define the Undefined Type Mapping Found for This

When you click “Select a Java file,” and create a Web service from it, this wizard displays if the selected Java file contains an undefined type mapping.

Click Add to launch the Web Service Type Mapping creation wizard to create a type mapping for this datatype.

NoteJava coding standards Web Services Toolkit follows Java coding standards. When you use any Java class name in your Web service, or user defined types in the IDL, the name must start with an upper case letter. If the names or types start with a lower case letter, you might see a “class not found” error.