Web Service Derived Types

<< Click to Display Table of Contents >>

SmartConnect 2017

Web Service Derived Types

A derived type is an object that was created based on a previously existing object. (e.g. base class) it inherits all of the properties and methods of the base class, and may add further properties and methods.



An abstract object called Person holds data the following data about a person:
oFirst name
oLast name
oPhone number
A second object called Contact derives from Person and adds an Organization field.
A third object called Employee also derives from Person and adds the following fields:
oEmployee code
oStart date
oPayroll number


The web service returns an object that contains a Person, the web service does not care if this Person is a Contact or an Employee, it will return either. When the method that returns the Person is selected in data source setup the Person field is displayed in blue as the web service is unsure as to the exact type of the Person object.



To enable the web service to return the correct information the type of the record should be selected. Select the lookup next to the derived type and select the correct type to be returned.


In this example if the Contact type is selected the data returned will be of type Contact.



If Employee is selected the data returned will be of type Employee.