09.12.2012 Views

webMethods Developer User's Guide - Software AG Documentation

webMethods Developer User's Guide - Software AG Documentation

webMethods Developer User's Guide - Software AG Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10. Performing Data Validation<br />

is validated against. This service returns a string that indicates whether validation was<br />

successful and an IData array that contains any validation errors. When you insert the<br />

pub.schema:validate service into a flow service, you can specify the maximum number of<br />

errors to be collected by the service. You can also specify whether the pub.schema:validate<br />

service should fail if the document (IData object) is invalid.<br />

For more information about the pub.schema:validate service, see the <strong>webMethods</strong> Integration<br />

Server Built-In Services Reference.<br />

Note: The validation engine in Integration Server performs document (IData object)<br />

validation automatically when a document is published. The validation engine validates<br />

the published document against the publishable document type.<br />

Tip! If you want to validate only String, String list, or String table variables in the pipeline,<br />

use the pub.schema:validatePipeline service. Define an IS document type that contains the<br />

variables you want to validate and apply constraints to the variables. Then use this IS<br />

document type as the blueprint for the pub.schema:validatePipeline service. Only the variables<br />

in the IS document type will be validated. The validation engine ignores other variables<br />

that exist in the pipeline at run time. (An IS document type implicitly allows unspecified<br />

variables to exist at run time.)<br />

Performing Pipeline Validation<br />

Pipeline validation is the process of verifying the contents of the pipeline against an IS<br />

document type. By validating pipeline data, you can:<br />

� Ensure a higher degree of accuracy for pipeline content.<br />

� Execute or not execute a service based on the validity of the pipeline data.<br />

� Eliminate extra validation code in your service.<br />

In pipeline validation, an IS document type is the blueprint or model against which you<br />

validate the pipeline. The constraints applied to the variables in the IS document type<br />

determine what can and cannot be included in the pipeline. For more information about<br />

applying constraints to variables, see “Applying Constraints to Variables” on page 261.<br />

To validate the pipeline, invoke the built-in service pub.schema:validatePipeline. This service<br />

instructs the validation engine to compare the pipeline contents against a specified IS<br />

document type. The pipeline is valid when it conforms to the structural and content<br />

constraints applied to the IS document type. The pub.schema:validatePipeline service returns a<br />

string that indicates whether validation was successful and an IData array (errors variable)<br />

that contains any validation errors. For more information about the<br />

pub.schema:validatePipeline service, see the <strong>webMethods</strong> Integration Server Built-In Services<br />

Reference.<br />

<strong>webMethods</strong> <strong>Developer</strong> User’s <strong>Guide</strong> Version 6.5, Service Pack 3 � � � 270

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!