ExportBaselineResult

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


Subject


Name

ExportBaselineResult — Exports the base line results to the specified location.

Syntax

.NET syntax

void ExportBaselineResult(BaselineRun baselineRun, 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 ExportBaselineResult API:

Table: IQueriesService - ExportBaselineResult - input parameters

Field name

Field type

Data type

Description

baselineRun

Mandatory

BaselineRun

The BaselineRun 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 - ExportBaselineResult - SOAP faults

Event

Description

InvalidArgumentError

You may be overriding the limitations of certain input parameters.

Sample: C#

//ExportBaselineResult
            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
            {
                //Get baselines for query.
                string queryName = "Query1";
                Baseline[] baselines = client.GetBaselines(null, queryName);
                // Get baseline runs
                BaselineRun[] baselineRuns = client.GetBaselineRuns(baseline[0]);
                // Export baseline results.
                client.ExportBaselineResult(baselineRuns[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
            BaselineRun baselineRun = new BaselineRun();
            baselineRun.setRunID("041fe578-e95c-4545-88c4-3fb5bf4a8653");
            ExportFormat exportFormat = ExportFormat.CSV;
            java.lang.String connectionStringOrPath = "C:\\Results";
            java.lang.String tableOrFileName = "1";
            port.exportBaselineResult(baselineRun, exportFormat, connectionStringOrPath, tableOrFileName);
        }
        catch (Exception exception)
        {
            System.out.println(exception.getMessage());
        }
   

Related links

See About IQueriesService.


Legacy ID



v71889948_v74603629


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


Terms of use for this information are found in Legal Notices