Professional Documents
Culture Documents
XML Services
Developers Guide
Version 7.1.1
January 2008
webMethods
ThisdocumentappliestowebMethodsIntegrationServerVersion 7.1.1andwebMethodsDeveloperVersion 7.1.1andtoallsubsequent releases. Specificationscontainedhereinaresubjecttochangeandthesechangeswillbereportedinsubsequentreleasenotesorneweditions. CopyrightSoftwareAG2008. Allrightsreserved. ThenameSoftwareAGand/orallSoftwareAGproductnamesareeithertrademarksorregisteredtrademarksofSoftwareAG.Other companyandproductnamesmentionedhereinmaybetrademarksoftheirrespectiveowners. Document ID: DEV-XML-DG-711-20080128
Table of Contents
About This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. Submitting and Receiving XML Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Submitting and Receiving XML in a String Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Submitting XML in a String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Receiving XML in a String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Submitting and Receiving XML in $xmldata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Submitting and Receiving XML in $xmldata . . . . . . . . . . . . . . . . . . . . . . . . . Submitting and Receiving XML via HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Client Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Submitting and Receiving XML via HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . Submitting and Receiving XML via FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Client Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FTPing a File from a webMethods Integration Server . . . . . . . . . . . . . . . . . . . . . . . . . Receiving XML via FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Submitting and Receiving XML via E-mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Client Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Sending XML via E-mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Receiving XML via E-mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Using the Load and Query Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What Are the Load and Query Services? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What Is Parsing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What Is a Node? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What Is a Query? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the loadXMLNode Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding loadXMLNode to a Flow Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Input and Output Values for loadXMLNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inputs for loadXMLNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The url variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The method variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The auth variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The data variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The headers variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The encoding variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The expandDTD variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The isXML variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7 7 9 10 10 10 11 11 11 13 13 14 14 15 16 16 17 17 17 18 19 20 20 20 20 20 21 21 22 22 22 23 24 25 30 31 32 33
Table of Contents
The loadAs variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The failOnHTTPError variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Output Values from loadXMLNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error Handling With loadXMLNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the queryXMLNode Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Passing a Node to queryXMLNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Addressing Information in a Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Working with a Sample Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The XML Node View Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Sample View Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding queryXMLNode to a Flow Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying a Query Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying a Query by Pointing to a Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using WQL and XQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using WQL in a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . webMethods Predefined Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Element Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying Multiple Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nested Element References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Scope of a WQL Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Referencing Data in Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Search Strings as Index Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wildcard Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Regular Expressions as Index Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Attribute Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Matching on the Name Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Masks to Extract Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Regular Expressions in a Mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Lines to Select Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Character Ranges to Extract Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using XQL in a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying a Method in XQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Element Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying Multiple Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nested Element References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Search Strings as Index Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying Elements with Particular Namespaces . . . . . . . . . . . . . . . . . . . . . Specifying Elements with Boolean Expressions . . . . . . . . . . . . . . . . . . . . . . . Specifying Elements with Comparison Operators . . . . . . . . . . . . . . . . . . . . . Quick Reference: WQL vs. XQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Output from queryXMLNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Handling Errors from queryXMLNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34 34 35 35 36 36 37 37 38 39 39 41 42 43 44 44 45 47 47 48 48 49 49 49 50 50 51 51 52 52 53 53 54 55 56 56 58 59 59 59 60 61 61
Table of Contents
Load and Query Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Generating Default Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Load and Query Service from a URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A. webMethods Query Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Object References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sibling Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Property Masking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
61 61 62 65 66 66 68 69 70 71
Table of Contents
Document Conventions
Convention Bold Italic Description Identifieselementsonascreen. Identifiesvariableinformationthatyoumustsupplyorchangebased onyourspecificsituationorenvironment.Identifiestermsthefirst timetheyaredefinedintext.Alsoidentifiesserviceinputandoutput variables. IdentifiesstoragelocationsforservicesonthewebMethods IntegrationServerusingtheconventionfolder.subfolder:service. Identifiescharactersandvaluesthatyoumusttypeexactlyor messagesthatthesystemdisplaysontheconsole. Identifieskeyboardkeys.Keysthatyoumustpresssimultaneously arejoinedwiththe+symbol. Directorypathsusethe\directorydelimiterunlessthesubjectis UNIXspecific. Optionalkeywordsorvaluesareenclosedin[].Donottypethe[] symbolsinyourowncode.
Narrow font
Typewriter font
UPPERCASE \ [ ]
Additional Information
ThewebMethodsAdvantageWebsiteathttp://advantage.webmethods.comprovides youwithimportantsourcesofinformationaboutwebMethodsproducts: Troubleshooting Information.ThewebMethodsKnowledgeBaseprovides troubleshootinginformationformanywebMethodsproducts. Documentation Feedback.ToprovidefeedbackonwebMethodsdocumentation,goto theDocumentationFeedbackFormonthewebMethodsBookshelf. Additional Documentation.Startingwith7.0,youhavetheoptionofdownloadingthe documentationduringproductinstallationtoasingledirectorycalled _documentation,locatedbydefaultunderthewebMethodsinstallationdirectory. Inaddition,youcanfinddocumentationforallwebMethodsproductsonthe webMethodsBookshelf.