
1103
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
Las
t
upda
te
d 8/5/2010
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:
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.
ColdFusion data type
WSDL data type
numeric
SOAP-ENC:double
Boolean
SOAP-ENC:boolean
string
SOAP-ENC:string
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 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...