User Guide

Table Of Contents
Handling complex data types 909
</cfsavecontent>
<cfset xml_obj = xmlparse(response_xml)>
<!--- Add the response header --->
<cfscript>
addSOAPResponseHeader("http://www.cfdevguide.com/",
"testresponseheader", "#xml_obj#");
ret = "Invoked as a web service. Use GetSOAPRequest and GetSOAPResponse
to view headers.";
</cfscript>
<cfelse>
<cfset ret = "Not invoked as a web service">
</cfif>
<cfreturn ret>
</cffunction>
</cfcomponent>
Handling complex data types
When dealing with web services, handling complex types falls into the following categories:
Mapping the data types of a web service to consume to ColdFusion data types
Understanding how clients will reference your ColdFusion data types when you publish a
web service
This section describes both categories.
Consuming web services that use complex data types
The following table shows how WSDL data types are converted to ColdFusion data types:
This table shows that complex data types map to ColdFusion structures. ColdFusion structures
offer a flexible way to represent data. You can create structures that contain single-dimension
arrays, multi-dimensional arrays, and other structures.
The ColdFusion mapping of complex types to structures is not automatic. You have to perform
some processing on the data in order to access it as a structure. The next sections describe how to
pass complex types to web services, and how to handle complex types returned from web services.
ColdFusion data type WSDL data type
numeric SOAP-ENC:double
boolean SOAP-ENC:boolean
string SOAP-ENC:string
array SOAP-ENC:Array
numeric SOAP-ENC:float
binary xsd:base64Binary
date xsd:dateTime
void (operation returns nothing)
structure complex type