ExportQueryResult

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


Subject


Name

ExportQueryResult — Exports the base line result to specified location.

Syntax

.NET syntax

void ExportQueryResult(QueryRun queryRun, 
ExportFormat exportFormat, string connectionStringOrPath, string tableOrFileName);

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

  • View All Jobs

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

  • Queries folder

Input parameters

The following table describes the input require by ExportQueryResult

Table: IQueriesService - ExportQueryResult - input parameters

Field name

Field type

Data type

Description

queryRun

Mandatory

QueryRun

The QueryRun object.

exportFormat

Mandatory

ExportFormat

The format to which the results need to be exported. The supported formats are CSV, XML, DOC, XLS, PDF and SQL.

connectionStringOrPath

Mandatory

String

The connection string or path to export the base line result

You must provide a share path for this parameter. For instance, \\Machine\Exports

tableOrFileName

Mandatory

String

The name of table.

Return value

The API returns void.

SOAP faults

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

Table: IQueriesService - ExportQueryResult - SOAP faults

Event

Description

InvalidArgumentError

You may be overriding the limitations of certain input parameters.

Sample: C#

 //ExportQueryResult
            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";
                Query[] queries = client.SearchQuery(queryName, platform, null, null, true);
                // Get query runs.
                QueryRun[] queryRun = client.GetQueryRuns(queries[0]);
                // Export baseline results.
                client.ExportQueryResult(queryRun[0], ExportFormat.PDF, "C:\\", "Results.pdf");
            }
            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
            QueryRun queryRun = new QueryRun();
            queryRun.setRunID("13202bbb-9f24-42b5-a08d-f62f65046839");
            ExportFormat exportFormat = ExportFormat.PDF;
            java.lang.String connectionStringOrPath = "C:\\Results";
            java.lang.String tableOrFileName = "1";
            port.exportQueryResult(queryRun, exportFormat, connectionStringOrPath, tableOrFileName);
        } 
        catch (Exception exception)
        {
            System.out.println(exception.getMessage());
        }
   

Related links

See About IQueriesService.


Legacy ID



v71890008_v74603629


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


Terms of use for this information are found in Legal Notices