User Guide

Table Of Contents
Consuming web services 897
For many of the most common data types, such as string and numeric, a WSDL data type maps
directly to a ColdFusion data type. For complex WSDL data types, the mapping is not as straight
forward. In many cases, you map a complex WSDL data type to a ColdFusion structure. For
more information on handling complex data types, see “Handling complex data types
on page 909.
Consuming ColdFusion web services
Your application can consume web services created in ColdFusion. You do not have to perform
any special processing on the input parameters or return values because ColdFusion handles data
mappings automatically when consuming a ColdFusion web service.
For example, when ColdFusion publishes a web service that returns a query, or takes a query as an
input, the WSDL file for that service lists its data type as QueryBean. However, a ColdFusion
application consuming this web service can pass a ColdFusion query object to the function as an
input, or write a returned QueryBean to a ColdFusion query object.
Note: For a list of how ColdFusion data types map to WSDL data types, see “Data conversions
between ColdFusion and WSDL data types” on page 896.
The following example shows a ColdFusion component that takes a query as input and echoes
the query back to the caller:
<cfcomponent>
<cffunction name='echoQuery' returnType='query' access='remote'>
<cfargument name='input' type='query'>
<cfreturn #arguments.input#>
</cffunction>
</cfcomponent>
In the WSDL file for the echotypes.cfc component, you see the following definitions that specify
the type of the functions input and output as QueryBean:
<wsdl:message name="echoQueryResponse">
<wsdl:part name="echoQueryReturn" type="tns1:QueryBean"/>
</wsdl:message>
<wsdl:message name="echoQueryRequest">
<wsdl:part name="input" type="tns1:QueryBean"/>
</wsdl:message>
array SOAP-ENC:Array
binary xsd:base64Binary
numeric xsd:float
string xsd:enumeration
date xsd:dateTime
void (operation returns nothing)
struct complex type
query tns1:QueryBean (Returned by CFCs)
ColdFusion data type WSDL data type