Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1113

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
<wsdl:operation name="echoString">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoStringRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/" namespace="http://ws" use="encoded"/>
</wsdl:input>
<wsdl:output name="echoStringResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/" namespace="http://ws" use="encoded"/>
</wsdl:output>
<wsdl:fault name="CFCInvocationException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/" name="CFCInvocationException" namespace=
"http://ws" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="echoService">
<wsdl:port binding="impl:echo.cfcSoapBinding" name="echo.cfc">
<wsdlsoap:address location="http://localhost:8500/ws/echo.cfc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Publish a web service
Create a ColdFusion page with the following content:
1
<cfcomponent output="false">
<cffunction
name = "echoString"
returnType = "string"
output = "no"
access = "remote">
<cfargument name = "input" type = "string">
<cfreturn #arguments.input#>
</cffunction>
</cfcomponent>
Save this file as echo.cfc in your web root directory.
2
Create a ColdFusion page with the following content:
3
<cfinvoke webservice ="http://localhost/echo.cfc?wsdl"
method ="echoString"
input = "hello"
returnVariable="foo">
<cfoutput>#foo#</cfoutput>
Save this file as echoclient.cfm in your web root directory.
4
5
Request echoclient.cfm in your browser.
The following string appears in your browser:
hello
You can also invoke the web service using the following code:
Last updated 1/20/2012
1108

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents