SmartConnect 2018

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.

 

e.g.

An abstract object called Person holds data the following data about a person:
oFirst name
oLast name
oPhone number
oEmail
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.

SmartConnect_WS_DS_Derived1

 

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.

SmartConnect_WS_DS_Derived2

 

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

SmartConnect_WS_DS_Derived3