Skip to main content

Example Web Service Consumer and Producer Applications

The examples and exercises in this part of the tutorial involve adding error-handling code to both a Web Service producer application and a Web Service consumer application. The Web Service producer application includes a simple Caché Contact Management application. The files for these applications have been provided for you as part of the Caché installation. You need to install them in the Caché namespace in which you will be working. See the Note below for a link to installation information for all example and exercise files.

The Contact Management application's data model consists of a pair of classes: Contact and PhoneNumber. These classes represent contacts and their phone numbers. Here's a diagram representing the application's object model:

generated description: exampleappobjmodel

Contact contains the following properties:

  • id — The object id. Unique for each instance of Contact. The value is automatically assigned by Caché. Studio does not display this property in either the Class Editor or the Inspector.

  • ContactType — Represents the type of a contact. Valid values include only “Business” and “Personal”.

  • Name — Represents the name of a contact. The value can be any %StringOpens in a new tab.

PhoneNumber contains the following properties:

  • id — The object id. Unique for each instance of PhoneNumber. The value is automatically assigned by Caché. Studio does not display this property in either the Class Editor or the Inspector.

  • PhoneNumberType — Represents the type of the phone number. Valid values include only “Business”, “Home”, “Fax”, and “Mobile”.

  • Number — Represents the phone number. The value can be any %StringOpens in a new tab. There are no restrictions on format.

In addition to supporting these properties, the two classes form a Parent-Child relationship. This means each Contact (parent class) object can contain any number of PhoneNumber (child class) objects. However, each PhoneNumber object must be contained in exactly one Contact. No PhoneNumber object can exist independently of any Contact and no PhoneNumber object can be contained in more than one Contact. This relationship is represented by the following pair of properties (not depicted on the diagram):

  • PhoneNumbers — Property of Contact. Represents the collection of PhoneNumber (child) objects contained in a Contact.

  • Contact — Property of PhoneNumber. Contains a reference to the PhoneNumber's parent Contact object.

Note:

For instructions on locating and installing the Caché application see Example and Exercise File Installation. After installing the Caché application, populate it with sample data. For instructions on populating the application, see Compiling and Populating the Sample Application.

FeedbackOpens in a new tab