Tech Rocks

Coldfusion
Java
JQuery

An online resource for latest web technologies like Coldfusion, JRun, Pro*C, JQuery, HTML5, PHP, W3C, Java, J2EE, C, C++, ORACLE, PL/SQL, MySql, Ajax, Coldbox, Fusebox, UNIX, JavaScript, NodeJS and much more... contact@tech-rocks.org

Wednesday, December 17, 2008

How to create webservice in coldfusion in WSDL

Create a CFC that uses remote functions in it.
Place the CFC in a folder anywhere in your PC.
Make that folder a Virtual Directory using IIS Mgr.
Once this is done type URl http://yourdomain.com/yourwebservicefolder/cfcservicename.cfc?wsdlin your browser. This will generate the wsdl for the webservice in xml format on the browser.
Save the output as cfcservicename.wsdl . Open the file and look for the path to the CFC. rename the path using your machines IP address.
write a client file in your wwwroot that access this webservice with the following code.
method="functionname"
returnvariable="Ret"
webservice="http://yourdomain.com/yourwebservicefolder/cfcservicename.wsdl">

Run this client file once on your coldfusion server.
This will create an entry in the webservices tab of your coldfusion administrator.
Once this entry is made in the administrator you can delete the cfcservicename.wsdl as the client page will be able to access the remote CFC from the .wsdl entry that is registered on the administrator.
Enjoy!

0 comments :