Show/Hide Toolbars

Therefore Web API Programming Interface 1.0

The ExecuteSimpleQuery operation allows you to conveniently specify a document query if your query meets the following conditions:

 

  bullet The query is executed in a single category (not a multi-query)

  bullet Conditions are specified for at most one category field.

  bullet Results are to be sorted by at most one category field.

 

If your query does not meet these conditions, you have to specify and execute a regular query. See ExecuteSingleQuery or ExecuteMultiQuery operations for more details.

 

 

 

 // 1. Create a channel factory to the web service endpoint

 ...

 ChannelFactory<IThereforeServicechannelFactory = new ChannelFactory<IThereforeService>(bindingendpoint);

 

 // 2. Create a channel to the web service endpoint

 IThereforeService service = channelFactory.CreateChannel();

 

 // 3. Create request parameters

 ExecuteSimpleQueryParams parameters = new ExecuteSimpleQueryParams();

 parameters.CategoryNo = CategoryIds.FilesCategory;

 parameters.FieldNo = CategoryIds.Files_Extension;

 parameters.Condition = "d*";

 parameters.OrderByFieldNo = CategoryIds.Files_Extension;

 

 // 4. Call the ExecuteSimple of a service

 ExecuteSimpleQueryResponse response = service.ExecuteSimpleQuery(parameters);

 

 // 5. Close the channel and channel factory.

 ((IClientChannel)service).Close();

 channelFactory.Close();

 

 // 6. Display a message box with the results.

 string info = "Rows found: " + response.QueryResult.ResultRows.Count + Environment.NewLine;

 response.QueryResult.ResultRows.ForEach( r => info += String.Format("Found document No: {0}, IndexValues count: {1}{2}", r.DocNo, r.IndexValues.CountEnvironment.NewLine));

 MessageBox.Show(info);

 

 

 

© 2024 Therefore Corporation, all rights reserved.