Creating and Consuming Web Services with CFML

Slides:



Advertisements
Similar presentations
31242/32549 Advanced Internet Programming Advanced Java Programming
Advertisements

CF and JSP/Servlets Developed originally by Robi Sen For the CF UnderGround II Seminar, Apr 2001 Edited and enhanced by Charlie Arehart (Robi had an emergency.
1 Web Services Based partially on Sun Java Tutorial at Also, XML, Java and the Future of The Web, Jon Bosak. And WSDL.
SOAP.
Web Services in ColdFusion 7 JaxFusion November, 2006.
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
2007 Adobe Systems Incorporated. All Rights Reserved. 1 Glenda Vigoreaux Adobe Certified Instructor roundpeg, Inc. Component Development.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 42 Web Services.
RSS RSS is a method that uses XML to distribute web content on one web site, to many other web sites. RSS allows fast browsing for news and updates.
1 Web Services Visual C# 2008 Step by Step Chapter 30.
Web service testing Group D5. What are Web Services? XML is the basis for Web services Web services are application components Web services communicate.
Doug Hughes, Alagad Inc. Drinkin’ Cold Coffee -or- How to use Java Objects from ColdFusion.
Building + Consuming WebServices CF Style Kevin Penny MMCP (4.5/5/MX6)
Step Outside the Box – Part II ColdFusion and Ajax.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
Software Architecture for ColdFusion Developers Unit 4: Application Events and Global Variables.
Data File Access API : Under the Hood Simon Horwith CTO Etrilogy Ltd.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
CSCI 6962: Server-side Design and Programming Web Services.
Web Services Week 7 Aims: A detailed look at the underlying mechanisms for communication between web services Objectives: SOAP, WSDL, UDDI.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Flex Data Communications Nick Kwiatkowski, Michigan State University.
1 ® Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 1 Building Portlets with ColdFusion Pete Freitag Foundeo, Inc.
New XML Features in CFMX Samuel Neff. Outline XML XPath XSLT What's next? New XML Features in CFMX –
Introduction to Web Services Instructor: Dr. M. Anwar Hossain.
Copyright © 2013 Curt Hill SOAP Protocol for exchanging data and Enabling Web Services.
CF101: Welcome to ColdFusion Simon Horwith CTO, Etrilogy Ltd.
XML Presented by Kushan Athukorala. 2 Agenda XML Overview Entity References Elements vs. Atributes XML Validation DTD XML Schema Linking XML and CSS XSLT.
CFCs in Practice Raymond Camden Senior Developer, Mindseye Technologies.
CFUNITED – The premier ColdFusion conference ColdFusion Components Ajay Sathuluri Based on presentation.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Theo Rushin, Jr. Senior Web Application Developer World Singles and DoubleBlack Technologies 12/26/
Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services.
ICM – API Server & Forms Gary Ratcliffe.
Web Services Martin Nečaský, Ph.D. Faculty of Mathematics and Physics Charles University in Prague, Czech Republic Summer 2014.
Developing Web Services with the Eclipse Web Tools Platform David Gallardo.
Web services In this presentation… –what is a web service? –web service benefits –web service standards –web service definitions –web service actions.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
Advance Caching Techniques Keen Haynes MKAD SCCFUG Winter 2002 Conference.
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
What’s New In CFML Matt Liotta. Agenda Overview Tag changes Function changes Small changes Large changes Nitpicking Q & A.
Using Structures With CFCs By Selene Bainum. June 27 th - 30 th 2007www.cfunited.com Why Am I here? Familiar with structures Familiar with ColdFusion.
CFUNITED – The premier ColdFusion conference Flex 2.0 and ColdFusion Integration – 101 Nahuel Foronda Laura Arguello.
CFUNITED – The premier ColdFusion conference David Epler Constella Group Choices: The Other ColdFusion Servers.
CFUNITED – The premier ColdFusion conference Using Event Gateways with CFMX7 By Jeff Tapper Tapper.net Consulting.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
CFUNITED – The premier ColdFusion conference CFMX7 Admin API Nate Nelson
Chaz Chumley Dynamic Presentations using ColdFusion 8.
CFUNITED – The premier ColdFusion conference Creating and Consuming Web Services with CFML Charlie Arehart
Coding With XML Andrew Schwabe
Java Web Services Orca Knowledge Center – Web Service key concepts.
GF and RS, Dept of CS, Mangalore University
API (Application Program Interface)
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Sabri Kızanlık Ural Emekçi
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
CF101: Welcome to ColdFusion
WEB SERVICES.
AJAX and REST.
GF and RS, Dept. of CS, Mangalore University
Ashish Pandit IT Architect, Middleware & Integration Services
Implementing a service-oriented architecture using SOAP
Offline Database Synchronization with SOAP and MySQL
Advanced Web Services: Soap Headers and more
Building a CF Administrator Interface in Flex
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
WEB SERVICES From Chapter 19, Distributed Systems
Chapter 42 Web Services.
.NET Web Services by Akram Mohammed.
Presentation transcript:

Creating and Consuming Web Services with CFML Chaz Chumley chaz@communitymx.com

What will be Covered Understanding Web Services Creating Web Services Consuming Web Services Error Handling Best Practices June 27th- 30th 2007 www.cfunited.com

About the Presenter 7 yrs CF Experience Application Developer – Lucidus.net Author/Partner – CommunityMx.com Instructor – University of Nevada Las Vegas Adobe User Group Manager – Las Vegas Frequent speaker: Conferences June 27th- 30th 2007 www.cfunited.com

Understanding Web Services What is a web service Web based application Consumed over the Internet Communicates and exchanges data Application, platform, syntax agnostic June 27th- 30th 2007 www.cfunited.com

Understanding Web Services How do web services work? SOAP – Simple Object Access Protocol XML based protocol Send and receive requests and responses WSDL – Web Services Descriptor Language Describes arguments accepted Describes methods & properties returned June 27th- 30th 2007 www.cfunited.com

Creating Web Services What is involved? Simple ColdFusion Component Method access modifier set to “Remote” Return data as string June 27th- 30th 2007 www.cfunited.com

Creating Web Services Building a Web Service - Exercise 1 Create a new CFC – hello.cfc Create new function called “getHello” Set access = “remote” Return string value <cfcomponent output="false"> <cffunction name="getHello" access="remote" returntype="string"> <cfreturn "Hello CFUnited" /> </cffunction> </cfcomponent> June 27th- 30th 2007 www.cfunited.com

Creating Web Services Testing a Web Service - Exercise 2 Viewing the WSDL http://dev.cfunited/hello.cfc?wsdl Calling Web Service method via URL http://dev.cfunited/hello.cfc&method=getHello June 27th- 30th 2007 www.cfunited.com

Consuming Web Services How do I call a web service? CFObject tag CFInvoke tag CreateObject() function June 27th- 30th 2007 www.cfunited.com

Consuming Web Services Using CFObject – Exercise 3 Object representing web service Referencing Web Service Methods Dot notation <cfobject webservice="http://dev.cfunited/hello.cfc?wsdl" name="ws"> <cfoutput>#ws.getHello()#</cfoutput> June 27th- 30th 2007 www.cfunited.com

Consuming Web Services Using CFInvoke – Exercise 4 Calls an instance of the web service <cfinvoke webservice="http://dev.cfunited/hello.cfc?wsdl" method="getHello" returnvariable="ws" /> <cfoutput>#ws#</cfoutput> June 27th- 30th 2007 www.cfunited.com

Consuming Web Services Using CreateObject() – Exercise 5 Object representing web service Referencing Web Service Methods Dot notation <cfset ws = createObject("webservice","http://dev.cfunited/hello.cfc?wsdl") /> <cfoutput>#ws.getHello()#</cfoutput> June 27th- 30th 2007 www.cfunited.com

Web Services Revisited Creating a more complex web service Web services with arguments – Exercise 6 Create new function called “getPersonalHello” Add an argument called “firstName” Return argument in a string <cffunction name="getPersonalHello" access="remote" returntype="string"> <cfargument name="firstName" type="string" default="Insert Name Here" /> <cfreturn "Hello #arguments.firstName#, hope you enjoy CFUnited" /> </cffunction> June 27th- 30th 2007 www.cfunited.com

Web Services Revisited Calling a web service with arguments Passing named argument Using CFInvokeArgument <cfinvoke webservice="http://dev.cfunited/hello.cfc?wsdl" method="getPersonalHello" returnvariable="ws"> <cfinvokeargument name="firstName" value="Chaz" /> </cfinvoke> <cfoutput>#ws#</cfoutput> June 27th- 30th 2007 www.cfunited.com

Web Services Revisited Consuming Third Party APIs SOAP based web services Easy to consume Type checked Simply output returned result REST based web services Lightweight – not a lot of extra xml markup Called using CFHttp Process result using XML functions June 27th- 30th 2007 www.cfunited.com

Web Services Revisited Consuming Yahoo Search Service http://developer.yahoo.com/search/ Get an Application ID Download the SDK Ray Camden's ColdFusion examples June 27th- 30th 2007 www.cfunited.com

Error Handling Any web service can throw errors Using a Try, Catch block Web service stub caching Any changes won't reflect until refreshed Using CF Admin to refresh proxy/stub Programatically refreshing cache Handling Null Value Arguments Omit attribute June 27th- 30th 2007 www.cfunited.com

Best Practices Creating a Web Service Alias Similar to creating a mapping Reference web service url with friendly name Limiting access to Web Service Using isSoapRequest() June 27th- 30th 2007 www.cfunited.com

Additional Resources Adobe Documentation CommunityMX ColdFusion MX 7 -- Web services -- Version 7 http://livedocs.adobe.com/coldfusion/7/ ColdFusion Developer Center http://www.adobe.com/devnet/coldfusion/webservices.html CommunityMX Consuming RSS Feeds in ColdFusion: Part 1 Using the Google API from ColdFusion Consuming the CMX Web Service with ColdFusion June 27th- 30th 2007 www.cfunited.com

Summary Simple to expose CFCs as web services Can consume SOAP and REST services Powerful prebuilt APIs from Yahoo, etc. Questions: chaz@communitymx.com June 27th- 30th 2007 www.cfunited.com