Thursday, 18 February 2016

Has your webservice code stopped working after ColdFusion10 because of Axis2 ?

In past few years I have seen many people struggling with their working webservice code which broke in ColdFusion10 onwards. Code works till CF9 but stops working since CF10 and they get errors like ServiceInvocationExcption or Axis2 AxisFault.

This happens because ColdFusion 9 introduced Axis2(Axis is the internal engine used in CF for SOAP based services) for their webservices. Axis1(the older version) is still available but is not the default one. This means that your existing code will now use axis2 engine by default. For most of the customers(I can assume 95%+) it works and performs better than previous versions but for some unfortunate of them it broke.

Here is what you need to make it work again.

Wednesday, 29 July 2015

CFB profiles and Preferences

CFB profiles and Preferences

Profiles is one of my favourite features of CFB3. It allows you to keep separate preferences as schemes(profiles we call it). For example when you are developing or writing code, you want to see your comments in yellow but when you demo your application you want to keep your comments in grey so they are not catchy. You don't have to change your comment colors always but you just have to switch your profile. To be specific you can maintain different color schemes, code-assist preferences, typing preferences, task tags, outline and syntax checking preferences with different profiles. For most developers modifying these small preferences increase their productivity, so trust me these are very helpful.

Here we will talk about how to maintain different profiles and also a bit about all these preferences that you can modify and play with and will be starting with Code Assist Preferences. To find them in CFB open Window->Preferences in your menubar. A preferences dialog will open. On left panel you have to reach to "ColdFusion->Profiles->Editor->Code Assist". On clicking it, in right panel you will see all related preferences.

Code Asisst:
For most of preferences, you will be able to understand what they do by their name, like in case of Code Assist they will help you modify what you see in code assist and how you get it and some related stuff.

Friday, 28 February 2014

CF New Mobile Project - Templates


You must be hearing about the mobile story in CF11, well yes, that is Huge. And if you haven't tried it yet, you are definitely missing a lot. Go on, try it but wait, don't you need a getting started tutorial. I bet you don't, only if you know that ColdFusion is providing templates for mobile project. Yes, you heard me right, templates. Isn't that great, you will get pre-baked code for your application. If you know what kind of application you want to create, just chose a template and wow! your application structure is ready. Alright, so now if you are interested enough to see how this works just read along otherwise still read along, I am sure you will feel like using it.

First thing first, this template feature is available in CFBuilder and being said that let me make you aware of the importance of CFBuilder3 with ColdFusion11. With CFB3 you will feel the actual power of mobile in CF11. Why is that? because with CFBuilder you can start right from scratch, use templates to create a mobile project, use builder's code assist to help you with new mobile functions, create a packaged application for iOS/Android, download it and install, DEBUG it from you device, inspect it with WEINRE and so much...

Now coming to the template feature, here are the steps you need to perform before you can try it.

Wednesday, 9 January 2013

Javascript Date Time parsing rules

Though these rules vary from browser to browser but still I am trying to put basic rules which are implemented by majority of popular browsers. To be on safer side please try these in your browser first.

JavaScript by default uses a simplified version of the ISO 8601 extended format to convert strings to Date objects

You can specify strings to construct Date objects either with Date(dateStr) or with Date.parse(dateStr). JavaScript first attempts to parse a date string by using the ISO format. If the date string is not in that format, JavaScript attempts to parse the date by using other date parsing rules.


The ISO format is a simplification of the ISO 8601 extended format. The format is as follows:

Friday, 13 July 2012

Axis-2 and Axis-1 compatibility issues

 Axis-2 and Axis-1 compatibility issues


Problem:

With ColdFusion 10 you can leverage power of Axis-2 WebServices. But you might get into issues if you are mixing Axis-2 with Axis-1. Axis-2 services are incompatible with Axis-1 services in ColdFusion because of the way their WSDL's are formed. Though by design Axis-1 and Axis-2 are compatible but in ColdFusion you might run into issues if you are using ColdFusion complex data types.

Since Axis-1 and Axis-2 are incompatible in ColdFusion, this means that if you are publishing your WebServices using Axis-2, then they should be consumed using Axis-2 only. Similarly if you are publishing your WebServices using Axis-1 then they should be consumed using Axis-1 only.

ColdFusion 10 Solution:

ColdFusion has taken all the measures to support backward compatibility with it's earlier versions. ColdFusion allows you to specify the version of Axis in which WebServices should be published or consumed. ColdFusion has given a control at three levels:

ColdFusion 10 WebServices - Axis2 vs Axis1

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.

Intro Axis:
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

Monday, 18 June 2012

Node.js to ColdFusion - REST api


In my earlier post I explained how to expose a pdf service using ColdFusion REST api here.
In that post we saw that from the client side if I will pass a html document to this service it will convert it into pdf document and will return it back to the client. Also in my earlier post I gave an example to consume it using CF client itself. But there are times when your client side may not be ColdFusion. For that purpose I am giving an example to consume it using Node.js

Node.js server will act as a client over here and will contact ColdFusion to convert a document into pdf document.

Let's take a look at the code.