Caché Web Services QuickStart Tutorial
Compiling and Populating the Sample Application
[Back] 
   
Server:docs2
Instance:LATEST
User:UnknownUser
 
-
Search:    

After you've installed the sample Caché application compile the classes and then populate Contact and PhoneNumber with sample data.

Compile Contact and then PhoneNumber by completing the following for each:
  1. Open the class in Caché Studio.
  2. Click Build —> Compile on the Caché Studio Menu Bar.
Once you have successfully compiled Contact and PhoneNumber you can populate them with data. Run the population utility from Caché Terminal. Complete the following steps for Contact and then for PhoneNumber:
  1. Launch Terminal from the Caché cube.
  2. At the Terminal prompt, use the ZN command to switch to the namespace containing your classes. For example, if the Terminal opens in SAMPLES and your classes are in USER, do the following:
    SAMPLES>zn "USER"
    USER>
    
  3. Next, use the populate utility to create a few instances of Contact. Here is the command to create five instances:
    USER>do ##class(SOAPTutorial.Contact).Populate(5)
    
    Note that the command requires that your provide the package name along with the classname using the PackageName.ClassName syntax. Populate's first argument, 5 in this case, specifies the number of instances to create. Passing a 1 in Populate's second argument causes the utility to provide feedback as it creates each instance.
If at some point in the future you want to remove all instances of Contact or PhoneNumber, use %KillExtent. The following command removes all instances of SOAPTutorial.Contact from TUTORIALS:
USER>do ##class(SOAPTutorial.Contact).%KillExtent()
Note:
You cannot create instances of PhoneNumber before you create instances of Contact. This is because the two classes form a parent-child relationship with Contact as the parent. Each PhoneNumber instance must belong to a Contact instance.
Click here to return to the Preface.
Click here to return to Part I: Publishing Web Services Using Caché.
Click here to continue to Part II: Consuming Web Services Using Caché.
Click here to continue to Part III: Web Service Error Handling in Caché.