Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Services in ColdFusion 7 JaxFusion November, 2006.

Similar presentations


Presentation on theme: "Web Services in ColdFusion 7 JaxFusion November, 2006."— Presentation transcript:

1 Web Services in ColdFusion 7 JaxFusion November, 2006

2 About the Presenter »David Fekke »API Team »Integration Developer »Working with SOAP based Web Services since 2002 when.NET 1.0 was released

3 What will be Covered »SOAP standard »WSDL files »Creating Web Services »Consuming Web Services »SOAP Headers in 6.1 and 7.0 »RPC vs Document style »REST vs SOAP »Cross Platform issues »Changing location endpoints

4 SOAP standard »Simple Object Access Protocol »Based on XML over HTTP »Used for application to application communication »It is platform and language agnostic »Came from XML-RPC »SOAP standard ratified in 2001 »ColdFusion uses Apache Axis

5 WSDL »Web Service Description Language »XML file that describes methods, parameters, data point and service address location »11 parts to a WSDL file »Four different styles, but only two supported by ColdFusion 7

6

7 Creating Web Services »CFCs are used to create Web Services »Method access modifier set to “Remote” »Duck typing should not be used with SOAP or Flash Remoting »Avoid using complex types such as Structures, multi-dimensional arrays, Query objects

8

9 Consuming Web Services »CFObject tag »CFInvoke tag, CFInvokeArgument tag »CreateObject() function »wsObj = createObject(“webservice”,”http://localhost/E choService.cfc?wsdl”) »returnValue = wsObj.echo(“Echo this string”)

10 Handling Complex return values »Hosting CF based SOAP, use separate CFC with CFProperty tags instead of structures to describe in the WSDL file. »CFDump tag really good for debugging »Complex values look like Java objects to ColdFusion

11 SOAP Headers »Different ways of handling in 6.1 and 7 »Some vendors require SOAP headers »Different from cgi.Headers

12 SOAP Headers in 6.1 »Requires patch after 6.1 or the 6.1 updater »Adobe has UDFs that mimic most of the behavior in 7 »Create a HeaderElement using Java object »"org.apache.axis.message.SOAPHeaderElement“ »Pass to setHeader method

13 <cfset WSObj = createObject("webservice","https://www.somecompany.com/services/somews.asmx?wsdl") />https://www.somecompany.com/services/somews.asmx?wsdl https://www.somecompany.com/services/ <!--- myUsername myPassword - 

14 SOAP Headers in 7 »Built-in methods »AddSOAPRequestHeader()AddSOAPRequestHeader »AddSOAPResponseHeader()AddSOAPResponseHeader »GetSOAPRequestHeader()GetSOAPRequestHeader »GetSOAPResponse()GetSOAPResponse »GetSOAPResponseHeader()GetSOAPResponseHeader »IsSOAPRequest()IsSOAPRequest »GetSOAPRequest()

15 RPC vs Document style »Style attribute in the cfcomponent tag » »Default style is RPC »Common WSDL styles are RPC/encoded and Document/literal and are supported by ColdFusion

16 REST vs SOAP »Representational State Transfer »Simple HTTP get or post »REST popular with AJAX applications because of simplicity »REST does not require verbose XML like SOAP »SOAP based on standard XML syntax »SOAP libraries can handle extra complexity

17 Cross Platform issues »Java and.NET support types not supported by standard SOAP types »DataSet is supported by.NET »Standard XML types supported »Fix is to serialize XML into a string

18 Changing location endpoints »Endpoint is the URL for the web service »Default endpoint is set in the WSDL file »ws = CreateObject("webservice", "http://localhost/service.cfc?WSDL"); »ws._setProperty("javax.xml.rpc.service.endpoin t.address", "http://92.169.1.20/service.cfc");

19 Useful tools »CFusionMX/runtime/bin/sniffer.exe »http://www.soapclient.com/http://www.soapclient.com/ »MicroSoft Fiddler »NetBeans 5 Web Service

20 Links »http://tjordahl.blogspot.com/2005/12/changin g-target-endpoint-on-web.htmlhttp://tjordahl.blogspot.com/2005/12/changin g-target-endpoint-on-web.html »http://www.macromedia.com/go/tn_18939http://www.macromedia.com/go/tn_18939 »http://www.fekke.com/blog/index.cfm/2005/ 9/21/UsingSOAPRequestHeadersinCFMX61http://www.fekke.com/blog/index.cfm/2005/ 9/21/UsingSOAPRequestHeadersinCFMX61 »http://www.fekke.com/blog/index.cfm/2006/ 6/9/Make-SOAP-based-Web-service-calls-with- Spryhttp://www.fekke.com/blog/index.cfm/2006/ 6/9/Make-SOAP-based-Web-service-calls-with- Spry »http://rip747.wordpress.com/2006/10/30/dotn et-dataset-to-cf-structure-of-queries/http://rip747.wordpress.com/2006/10/30/dotn et-dataset-to-cf-structure-of-queries/


Download ppt "Web Services in ColdFusion 7 JaxFusion November, 2006."

Similar presentations


Ads by Google