ColdFusion | WebServices
I have seen many people getting confused between Axis-2 and Axis-1 WebServices in ColdFusion 10. ColdFusion 10 has added the support for Axis-2 WebService, earlier till ColdFusion 9 only Axis-1 WebServices were supported.
So to begin with what exactly is this Axis-2 and Axis-1.
Apache Axis (Axis-1) is an open source, XML based Web service framework. ColdFusion internally uses Axis to publish and consume WebServices. Apache Axis-2 is a complete re-design and re-write of the widely used Apache Axis but achieves same purpose. Axis-2 supports many new and flexible features over Axis-1 which means ColdFusion has implemented it not only to provide you latest features like Soap1.2 but also to give you more flexibility and power in your hand. You can always search for 'Axis-1 vs Axis2' if you want to study the advantages of Axis-2.
New in ColdFusion 10
So let's see what ColdFusion 10 is offering with Axis-2
- SOAP 1.2 support (SOAP 1.1 was there with Axis-1)
- WSDL2 support
- Wrapped styled WSDL support
- Easy switching from Axis-2 to Axis-1 and vice-versa.
Taking these points one by one.
- SOAP 1.2 support - SOAP is a standard protocol specification for exchanging messages and 1.2 is it's latest version. Being a ColdFusion user you should not worry about the implementation part but you should know that now you can consume much wider range of WebServices and also publish for a much wider userbase.
- WSDL2 support - WSDL is a standard XML format to expose your WebServices to outer World. Versoin 2 is the latest version of WSDL and now with ColdFusion 10 you can leverage it. Implementation is as expected way too simple.
The WebService WSDL links are like these : http://myip/mywebservice.cfc?wsdl
The WebService WSDL2 links are like these : http://myip/mywebservice.cfc?wsdl2
Now to consume these WebServices using WSDL2 format just update the WSDL link by appending a numeric '2' in the end and you will be done. No change required from publishing side.
- Wrapped styled WSDL - A user who has already used WebServices in any platform might be aware of terms like RPC style, Document-literal, Document-wrapped style WSDL. WSDL publishing formats could be in either of these widely used formats. Earlier RPC and Document-literal styles were supported but now Document-wrapped style is also supported.To use this a style attribute is provided at two level: Application level and Component level.
- Application level:
<cfset this.wssettings.style = "Wrapped | Document | RPC">
- Component level:
<cfcomponent wsversion="2" style="Document | Wrapped | RPC" > For in-depth details about new attributes in ColdFusion 10 WebServices read this blog here.
- Application level:
- Easy Switching - Axis-1 and Axis-2 has few compatibility issues because of their architecture which means if you are publishing in Axis-1, it has to be consumed by Axis-1 only and if a WebService is published in Axis-2 then it has to be consumed using Axis-2 only. ColdFusion is well aware that the users could face problem because of this behavior. So to it make very easy for users, ColdFusion 10 has taken few steps which are discussed in detail in this blog here.
You may also like reading this -> http://www.adobe.com/devnet/coldfusion/articles/axis2-web-services.html