User Guide

Table Of Contents
10 Contents
PART VI: Using Web Elements and External Objects
CHAPTER 35: Using XML and WDDX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
About XML and ColdFusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
The XML document object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
ColdFusion XML tag and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
Using an XML object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852
Creating and saving an XML document object . . . . . . . . . . . . . . . . . . . . . . . . . . 856
Modifying a ColdFusion XML object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
Validating XML documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
Transforming documents with XSLT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
Extracting data with XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
Example: using XML in a ColdFusion application . . . . . . . . . . . . . . . . . . . . . . . 870
Moving complex data across the web with WDDX . . . . . . . . . . . . . . . . . . . . . . . 875
Using WDDX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
CHAPTER 36: Using Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
Web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
Working with WSDL files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888
Consuming web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
Publishing web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898
Using request and response headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
Handling complex data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909
Troubleshooting SOAP requests and responses . . . . . . . . . . . . . . . . . . . . . . . . . . 914
CHAPTER 37: Integrating J2EE and Java Elements in
CFML Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917
About ColdFusion, Java, and J2EE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917
Using JSP tags and tag libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921
Interoperating with JSP pages and servlets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 922
Using Java objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 928
CHAPTER 38: Integrating COM and CORBA Objects in
CFML Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
About COM and CORBA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
Creating and using objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947
Getting started with COM and DCOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 948
Creating and using COM objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951
Getting started with CORBA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961
Creating and using CORBA objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961
CORBA example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969