SearchQuery

Article:HOWTO76894  |  Created: 2012-05-07  |  Updated: 2012-05-08  |  Article URL http://www.symantec.com/docs/HOWTO76894
Article Type
How To


Subject


Name

SearchQuery — Finds the queries into the queries system according to the specified inputs.

Syntax

.NET syntax:

Query[] SearchQuery(string name, string platform, string dataSource, string containerPath, bool searchSubtree);

Service URLs

Use the following URLs to access the IQueriesService:

  • http://<localhost>/CCS/Services/Applications/Queries/IQueriesService/WS/WindowsSecurity

  • https://<localhost>:<portnumber>/CCS/Services/Applications/Queries/IQueriesService/WS/WindowsSecurity

  • https://<localhost>:<portnumber>/CCS/Services/Applications/Queries/IQueriesService/WS/UsernameSecurity

  • https://<localhost>:<portnumber>/CCS/Services/Applications/Queries/IQueriesService/Basic/UsernameSecurity

Authorization Requirements

You must have the following CCS tasks to use the API:

  • View Queries

You must have the permissions on the following folder to use the API:

  • Queries folder

Input parameters

The SearchQuery API requires the following input parameters:

Table: IQueriesService- SearchQuery- input parameters

Field name

Field type

Data type

Description

name

Optional

String

The query name used for search.

platform

Optional

String

The platform of query.

dataSource

Optional

String

The data source of query.

containerPath

Optional

String

The path of the container used for search.

searchSubtree

Optional

Boolean

The search criteria which is either current level or subtree.

Return value

The SearchQuery API returns the Query Object in the return value:

Table: IQueriesService- Query Object- return value

Field name

Data type

Description

Name

String

Specifies the name of query.

QueryID

Guid

Specifies the unique identifier of query.

Description

String

Specifies the description of query.

Platform

String

Specifies the platform of query.

DataSource

String

Specifies the data source of query.

ContainerPath

String

Specifies the path of the container used for search.

SOAP faults

All the error results are returned to the calling application as SOAP faults:

Table: IQueriesService - SearchQuery - SOAP faults

Event

Description

InvalidArgumentError

You may be overriding the limitations of certain input parameters.

Sample: C#

// SearchQuery
            QueriesServiceClient client = new QueriesServiceClient();
            client.ClientCredentials.UserName.UserName = "e2edom\\administrator";
            client.ClientCredentials.UserName.Password = "password@123";
            System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);

            try
            {
                // Search for sepcific query.
                string queryName = "Query1";
                string platform = "Windows";
                string entity = null;
                string containerPath = null;
                bool searchSubTree = true;
                Query[] queries = client.SearchQuery(queryName, platform, entity, containerPath, searchSubTree);
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp.Message);
            }

Sample: Java client

try
        {
            // Call Web Service Operation
            QueriesService service = new QueriesService();
            IQueriesService port = service.getBasicHttpBindingIQueriesService();
            // TODO initialize WS operation arguments here
            java.lang.String name = "";
            java.lang.String platform = "";
            java.lang.String dataSource = "";
            java.lang.String containerPath = "";
            java.lang.Boolean searchSubtree = Boolean.TRUE;
            // TODO process result here
            ArrayOfQuery result = port.searchQuery(name, platform, dataSource, containerPath, searchSubtree);
            List<Query> queries = result.getQuery();
            Query query = result.getQuery().get(0);
            String id = query.getQueryID();
            System.out.println("Result = "+result);
        }
        catch (Exception exception)
        {
             System.out.println(exception.getMessage());
        }
   

Related links

See About IQueriesService.


Legacy ID



v71889592_v74603629


Article URL http://www.symantec.com/docs/HOWTO76894


Terms of use for this information are found in Legal Notices