Adobe COLDFUSION 9 Manual page 1103

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
Component
Definition
fault
(not shown) Optionally specifies an error message returned from the operation.
Specifies the protocol used to access a web service including SOAP, HTTP GET and POST, and MIME.
binding
service
Defines a group of related operations.
Defines an operation and its associated inputs and outputs.
port
For additional descriptions of the contents of this WSDL file, see
Consuming web services
ColdFusion provides a variety of methods for consuming web services. The method that you choose depends on your
ColdFusion programming style and application.
The following table describes these methods:
Method
CFML operator
CFScript
()
CFML tag
CFML tag
One important consideration is that all consumption methods use the same underlying technology and offer the same
performance.
About the examples
The examples shown here reference the TemperatureService web service from XMethods. This web service returns the
temperature for a given ZIP code. You can read the WSDL file for this web service in
page 1096.
The TemperatureService web service has one input parameter, a string that contains the requested ZIP code. It returns
a float that contains the temperature for the specified ZIP code.
Passing parameters to a web service
The message and operation elements in the WSDL file contains subelements that define the web service operations
and the input and output parameters of each operation, including the data type of each parameter. The following
example shows a portion of the WSDL file for the TemperatureService web service:
<message name="getTempRequest">
<part name="zipcode" type="xsd:string"/>
</message>
<message name="getTempResponse">
<part name="return" type="xsd:float"/>
</message>
<portType name="TemperaturePortType">
<operation name="getTemp">
<input message="tns:getTempRequest"/>
<output message="tns:getTempResponse"/>
</operation>
</portType>
"Consuming web
Description
Consumes a web service from within a CFScript block.
Consumes a web service from within a block of CFML code.
Consumes a web service from within a block of CFML code.
Last updated 8/5/2010
services" on page 1098.
"Reading a WSDL
file" on
1098

Advertisement

Table of Contents
loading

Table of Contents