ColdFusion data type
void (operation returns nothing)
struct*
This table shows that complex data types map to ColdFusion structures. ColdFusion structures
offer a flexible way to represent data. You can create structures that contain single-dimension
arrays, multi-dimensional arrays, and other structures.
The ColdFusion mapping of complex types to structures is not automatic. You have to perform
some processing on the data in order to access it as a structure. The next sections describe how to
pass complex types to web services, and how to handle complex types returned from web services.
Passing input parameters to web services as complex types
A web service can take a complex data type as input. In this situation, you can construct a
ColdFusion structure that models the complex data type, then pass the structure to the web
service.
For example, the following excerpt from a WSDL file shows the definition of a complex type
named Employee:
<s:complexType name="Employee">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="fname" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="lname" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="active" type="s:boolean" />
<s:element minOccurs="1" maxOccurs="1" name="age" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="hiredate" type="s:dateTime" /
>
<s:element minOccurs="1" maxOccurs="1" name="number" type="s:double" />
</s:sequence>
</s:complexType>
The Employee data type definition includes six elements, the data type of each element, and the
name of each element.
Another excerpt from the WSDL file shows a message definition using the Employee data type.
This message defines an input parameter, as the following code shows:
<message name="updateEmployeeInfoSoapIn">
<part name="thestruct" type="s0:Employee" />
</message>
A third excerpt from the WSDL file shows the definition of an operation, named
updateEmployeeInfo, possibly one that updates the employee database with the employee
information. This operation takes as input a parameter of type Employee, as the following code
shows:
<operation name="updateEmployeeInfo">
<input message="s0:updateEmployeeInfoSoapIn" />
</operation>
WSDL data type
complex type
Handling complex data types
729
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers