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:
<messagename="getTempRequest"> <part name="zipcode"type="xsd:string"/> </message> <messagename="getTempResponse"> <part name="return"type="xsd:float"/> </message>
As part of consuming web services, you must understand how ColdFusion MX converts WSDL defined data types to ColdFusion data types. The following table shows this conversion:
| 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) |
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.