User Guide

Table Of Contents
Publishing web services 899
By defining the function as remote, ColdFusion includes the function in the WSDL file. Only
those functions marked as remote are accessible as a web service.
The following list defines the requirements for how to create web services for publication:
1.
The value of the access attribute of the cffunction tag must be remote.
2.
The cffunction tag must include the returnType attribute to specify a return type.
3.
The output attribute of the cffunction tag must be set to No because ColdFusion converts all
output to XML to return it to the consumer.
4.
The attribute setting required="false" for the cfargument tag is ignored. ColdFusion
considers all parameters as required.
Specifying data types of function arguments and return values
The
cffunction tag lets you define a single return value and one or more input parameters
passed to a function. As part of the function definition, you include the data type of the return
value and input parameters.
The following example shows a component that defines a function with a return value of type
string, one input parameter of type string, and one input parameter of type numeric:
<cfcomponent>
<cffunction name="trimString" returnType="string" output="no">
<cfargument name="inString" type="string">
<cfargument name="trimLength" type="numeric">
</cffunction>
</cfcomponent>
As part of publishing the component for access as a web service, ColdFusion generates the WSDL
file that defines the component where the WSDL file includes definitions for how ColdFusion
data types map to WSDL data types. The following table shows this mapping:
ColdFusion data type WSDL data type published
numeric SOAP-ENC:double
boolean SOAP-ENC:boolean
string SOAP-ENC:string
array SOAP-ENC:Array
binary xsd:base64Binary
date xsd:dateTime
guid SOAP-ENC:string
uuid SOAP-ENC:string
void (operation returns nothing)
struct Map
query QueryBean