Adobe COLDFUSION 9 Manual page 1108

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
Not only does registering the service in the Administrator enable you to shorten your code, it lets you change a web
service URL without modifying your code. So, if the TemperatureService web service moves to a new location, you only
update the administrator setting, not your application code.
For more information, see the ColdFusion Administrator online Help.
Data conversions between ColdFusion and WSDL data types
A WSDL file defines the input and return parameters of an operation, including data types. For example, the
TemperatureService web service contains the following definition of input and return parameters:
<message name="getTempRequest">
<part name="zipcode" type="xsd:string"/>
</message>
<message name="getTempResponse">
<part name="return" type="xsd:float"/>
</message>
As part of consuming web services, understand how ColdFusion converts WSDL defined data types to ColdFusion
data types. The following table shows this conversion:
ColdFusion data type
numeric
Boolean
string
array
binary
numeric
string
date
void (operation returns nothing)
struct
query
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 1115.
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.
WSDL data type
SOAP-ENC:double
SOAP-ENC:boolean
SOAP-ENC:string
SOAP-ENC:Array
xsd:base64Binary
xsd:float
xsd:enumeration
xsd:dateTime
complex type
tns1:QueryBean (Returned by CFCs)
Last updated 8/5/2010
1103

Advertisement

Table of Contents
loading

Table of Contents