Integrate > Service Manager integration methods and tools > Web Services > SOAP API > Consuming a Service Manager Web Service > Example: Retreiving data from Service Manager via a Web service

Example: Retreiving data from Service Manager via a Web service

The simplest way to perform retrieval operations is via Query-by-example (QBE). This is done by creating an instance of a particular kind of object (such as an Incident) and populating one or more fields with values to determine the result set. You have to only supply values for the fields on which you wish to select.

The instance is then passed into a RetrieveXXXKeysList request. In a program, such as the sample programs provided with Service Manager, you would be assigning values to properties or calling setter methods on various Java or C# or other objects. In the following example, we submit a RetrieveIncidentKeysList object, supplying a value for OpenedBy and UpdatedBy. In this example, we will use Service Manager query syntax to find all incidents where the OpenedBy element starts with “fal” as well as pass a literal value for the UpdatedBy field.

We get back a RetrieveIncidentKeysListResponse object listing the primary keys of the matching Incident objects.

Combining multiple values in this QBE style selection connects the query terms with AND. To create a query using OR, supply an expert query as a string in the <pws:instance query="xxx" …> area.