Well, here is the *very* basic lowdown:
Setup a .CFC with functions that have accesstype="remote"
Here is a basic example, lets say you have a file called webservice.cfc
in your web root of www.mysite.com. Here is the code for
webservice.cfc:
<cfcomponent name="webservice" hint="Contains all remote functions">
<cffunction name="sayhello" access="remote" returntype="string"
output="false" hint="Returns a hello string">
<cfreturn 'Hello' />
</cffunction>
</cfcomponent>
Coldfusion will automatically create a wsdl definition for this, you can
look at it by pointing your browser to it, and adding ?WSDL at the end,
like this for my example:
http://www.mysite.com/webservice.cfc?wsdl
To 'consume' this from coldfusion, do this:
<!---// Create an object of my entire web service //--->
<cfobject webservice="http://www.mysite.com/webservice.cfc?wsdl"
name="myService">
<!---// Call my sayHello function //--->
<cfset returnString = myService.sayhello() />
<cfoutput>#returnString#</cfoutput>
That is a super simple example, but you get my drift. I have a .NET app
that consumes a web service in CF, which returns XML as a string, and we
base64 encode scanned images and send them over the web to a webservice.
Hope this helps you get on the right track, let me know if you need more
help!
Chris Peterson
-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED]
Sent: Friday, September 29, 2006 9:40 AM
To: CF-Talk
Subject: Re: Two Databases on Two Servers Conundrum
> Why not set up a web service
I've not worked with web services before.
Suggestions for a good tutorial or examples?
Thanks,
Les
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254750
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4