Adobe COLDFUSION 9 Manual page 1099

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
Referencing a remote web service within your ColdFusion application is called consuming web services. Since web
services adhere to a standard interface regardless of implementation technology, you can consume a web service
implemented as part of a ColdFusion application, or as part of a .NET or Java application.
You can also create your own web services and make them available to others for remote access, called publishing web
service. Applications that consume your web service can be implemented in ColdFusion or by any application that
recognizes the web service standard.
Accessing a web service
In its simplest form, an access to a web service is like a function call. Instead of the function call referencing a library
on your computer, it references remote functionality over the Internet.
One feature of web services is that they are self-describing. A person who makes a web service available also publishes
a description of the API to the web service as a Web Services Description Language (WSDL) file.
A WSDL file is an XML-formatted document that includes information about the web service, including the following
information:
• Operations that you can call on the web service
• Input parameters that you pass to each operation
• Return values from an operation
Consuming web services typically is a two-step process:
Parse the WSDL file of the web service to determine its interface.
1
A web service makes its associated WSDL file available over the Internet. You must know the URL of the WSDL
file defining the service. For example, you can access the WSDL file for the TemperatureService web service at the
following URL:
www.xmethods.net/sd/2001/TemperatureService.wsdl
For an overview of WSDL syntax, see
Make a request to the web service.
2
The following example runs an operation on the Temperature web service to retrieve the temperature in ZIP code
55987:
<cfinvoke
webservice="http://www.xmethods.net/sd/2001/TemperatureService.wsdl"
method="getTemp"
returnvariable="aTemp">
<cfinvokeargument name="zipcode" value="55987"/>
</cfinvoke>
<cfoutput>The temperature at ZIP code 55987 is #aTemp#</cfoutput>
For more information on consuming web services, see
Basic web service concepts
To fully understand how web services work make sure that you are familiar with the underlying architecture of a web
service provider.
Note: For detailed information, consult one of the many web services books.
The following are three primary components of the web services platform:
• SOAP (Simple Object Access Protocol)
"Working with WSDL
files" on page 1095.
"Consuming web
Last updated 8/5/2010
services" on page 1098.
1094

Advertisement

Table of Contents
loading

Table of Contents