Share this page

# Example: soa_xml_validate

This example shows the use of soa_xml_validate to validate an XML string.

soa_xml_validate ("StepName=XmlValidation_1668244591",

"Snapshot=t6879361c81df464c8ebbe2abd390c711.inf",

"XML={noteParam}",

"StopOnValidationError=0",

"XSD=C:\\a\\noteNum\\note_num.xsd",

BEGIN_CHECKPOINTS,

CHECKPOINT, "XPATH=/*[local-name(.)='note'][1]

/*[local-name(.)='to'][1]","Value_Equals=Tom*?e",

CHECKPOINT, "XPATH=/*[local-name(.)='note'][1]

/*[local-name(.)='from'][1]","Value_Equals=Jani",

CHECKPOINT, "XPATH=/*[local-name(.)='note'][1]

/*[local-name(.)='heading'][1]","Value_Equals=Reminder",

CHECKPOINT, "XPATH=/*[local-name(.)='note'][1]

/*[local-name(.)='body'][1]","Value_Equals=weekend!",

END_CHECKPOINTS,

LAST );

The following example illustrates the collaboration between a REST Web Service and XML Validation. In the example, AccessKeyId in the http request must be replaced with a registered private access key.

Action()

{

web_reg_save_param("WCSParam_Text1",

"LB=",

"RB=",

"Ord=1",

"RelFrameId=1",

"Search=Body",

"IgnoreRedirections=Yes",

LAST );

//This step performs the service request.

web_url("xml",
"URL=http://MyBookWorld.com/xml?Service=MyBookWorldService=ItemSearch&AccessKeyId=1234567890ABCD&SearchIndex=Books&Keywords=Cortisol&Author=Austin",

"Resource=0",

"RecContentType=text/xml",

"Referer=",

"Snapshot=t1.inf",

"Mode=HTML",

LAST );

// This step validates the results.

soa_xml_validate ("StepName=XmlValidation_1",

"Snapshot=t3e218cbb28a34f019d7c76e541665794.inf",

"XML={BookParam_Text1}",

"StopOnValidationError=0",

"XSD=C:\\MyScripts\\MyBookWorld.xsd",

BEGIN_CHECKPOINTS,

CHECKPOINT,"XPATH=/ItemSearchResponse/OperationRequest/RequestId","Value_Equals=Austin",

END_CHECKPOINTS,

LAST );

return 0;

}

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: