I was recently asked to help some developers that are new to CFML to try to learn a bit more about how ColdFusion and Web Services work, so I put together a little sample app (it's just two files) that shows how web services are published and consumed using CFML. The zip file can be found at
http://www.horwith.com/downloads/soapexample.zip. Simply unzip the file to a coldfusion server somewhere off it's root and then browse to the "soapexample" directory that was created by the unzip process. The index.cfm file you browse to explains everything else (it assumes you're using CF for J2EE but if you're not, the code won't require tweaking any more than it might for anybody else who is running the J2EE version).
It's nothing very complicated - that's the point. I was trying to show how simple it is to do these things as well as teach the syntax.
There's one bit that I can't seem to get right. You mention in the comments that "This file assumes the path to the current directory (from your cfusion_war directory) is "soapexample"".
I don't have a cfusion_war directory... do you know what I should look for? The error I'm getting is as follows, and I think it's because of that variable:
==============
coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler: Found 1 semantic error compiling "C:/CFusionMX7/stubs/WS-1878490784/soapexample_pkg/SOAPExampleLocator.java": 10. public class SOAPExampleLocator extends org.apache.axis.client.Service implements soapexample_pkg.SOAPExample { <---------> *** Error: Type soapexample_pkg/SOAPExample was not found.
======================
Thanks for your help!
<cfcomponent>
<cffunction name="echoQuery" access="remote" returntype="query">
<cfquery name="result" datasource="#request.dsn#">
SELECT Firstname
FROM Loger
</cfquery>
<cfreturn result>
</cffunction>
</cfcomponent>
_________________________
<cfinvoke
webservice="http://www.wrighter.com/cfca/xmlserv/users-works3....
method="echoQuery"
returnvariable="result">
</cfinvoke>
<cfdump var="#result#">
I just looked at your WSDL and then I ran your code, and it works fine for me!
http://www.wrighter.com/cfca/testwebservices-works...
Web service operation "echoQuery" with parameters {} could not be found.
The error occurred in D:\Inetpub\wrighter\cfca\TestWebServices-Works3.cfm: line 6
4 : webservice="http://www.wrighter.com/cfca/xmlserv/users-works3....
5 : method="echoQuery"
6 : returnvariable="result">
7 : </cfinvoke>
http://www.maplestorymesosshop.com http://www.maplestorymesosstore.com maple story mesos