My favorites | Sign in
Project Logo
                
Search
for
Updated Jan 05, 2008 by gerald.lester
Labels: Featured, User_Guide
WSTypes  

Creating a Web Service Type from Tcl

Overview

Webservice Type declaration is part of the Webservices Utility package.

When writing a web service it is often requried to write a complex type definition for an argument containing structured data.

When calling an operation on a web service it is sometimes convient to define a complex type to return structured data as an XML fragment even though the sevice may state that it is only expecting a string.

Loading the Webservices Utility Package

To load the webservices server package, do:

package require WS::Utils

This command will only load the utilities the first time it is used, so it causes no ill effects to put this in each file using the utilties.

Defining a type

Procedure Name: ::WS::Utils::ServiceTypeDef

Description: Define a type for a service.

Arguments:

Returns: Nothing

Side-Effects: None

Exception Conditions: None

Pre-requisite Conditions: None

Defining a derived type

Procedure Name: ::WS::Utils::ServiceSimpleTypeDef

Description: Define a derived type for a service.

Arguments:

Returns: Nothing

Side-Effects: None

Exception Conditions: None

Pre-requisite Conditions: None

Getting a type definition

Procedure Name: ::WS::Utils::GetServiceTypeDef

Description: Query for type definitions.

Arguments:

Returns:

If type not provided, a dictionary object describing all of the types for the service. If type provided, a dictionary object describing the type. A definition consist of a dictionary object with the following key/values:
  • xns - The namespace for this type.
  • definition - The definition of the type's fields. This consist of one or more occurance of a field definition. Each field definition consist of: "fieldName fieldInfo" Where fieldInfo is: {type typeName comment commentString}, typeName can be any simple or defined type and commentString is a quoted string describing the field.

Side-Effects: None

Exception Conditions: None

Pre-requisite Conditions: The service must be defined.


Sign in to add a comment
Hosted by Google Code