Adobe COLDFUSION 9 Manual page 1106

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
<cfscript>
ws = CreateObject("webservice",
"http://www.xmethods.net/sd/2001/TemperatureService.wsdl");
xlatstring = ws.getTemp(zipcode = "55987");
writeoutput("The temperature at 55987 is " & xlatstring);
</cfscript>
Consuming web services that ColdFusion does not generate
To consume a web service that is implemented in a technology other than ColdFusion, the web service must have one
of the following sets of options:
• rpc as the SOAP binding style and encoding as the encodingStyle
• document as the SOAP binding style and literal as the encodingStyle
The following example shows a portion of the WSDL file for the TemperatureService web service:
<binding name="TemperatureBinding" type="tns:TemperaturePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getTemp">
<soap:operation soapAction=""/>
<input>
<soap:body use="encoded" namespace="urn:xmethods-Temperature"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:xmethods-Temperature"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
The WSDL file for the TemperatureService web service is compatible with ColdFusion because it uses rpc as the
binding style, and encoding as the encodingStyle.
Calling web services from a Flash client
The Flash Remoting service lets you call ColdFusion pages from a Flash client, but it does not let you call web services
directly. To call web services from a Flash client, you can use Flash Remoting to call a ColdFusion component that calls
the web service. The Flash client can pass input parameters to the component, and the component can return to the
Flash client any data returned by the web service.
For more information, see
"Using the Flash Remoting
Catching errors when consuming web services
During processing, you can catch in your application errors, including SOAP faults, that otherwise propagate to the
browser.
To catch errors, you specify an error type of application to the ColdFusion
shows:
Service" on page 606.
Last updated 8/5/2010
tag, as the following example
cfcatch
1101

Advertisement

Table of Contents
loading

Table of Contents