.NET components via ColdFusion – a practical example with v3 Leisure CABS

We recently came across a project where our client, a holiday listing site, wanted to integrate with a third party information provider. Not a problem we said! It turns out that the .NET webservice was something like we had never seen before. There were no arguments or datatypes, just an input of some XML against a DTD. This meant that instead of passing in a number of arguments, we had to get just one, the XML that would normally be generated by ColdFusion, wrapped in the SOAP envelope and sent.

If you have had any major dealings with webservices in CF then you will know that there is no fine grain control over how CF puts the SOAP packets together. We tried a few different avenues and quickly discovered that passing a datatype of XML to the webservices resulted in CF running XMLParse over the XML we put in. Clearly not the correct result. The next (and our last) option was to look at going around the CF SOAP constructor using Java, but with a lack of skills at the time it didn't seem to be an option.

Enter .NET, and the V3 example app. This came with a dll file that did the SOAP wrapping and took some straight XML from the sample application. It was a long shot but hey, we were out of options. So we took the dll and asked CF to open it as a native object. It works brilliantly. To get inside the dll we used Lutz Reflector to find methods and arguments. CF didn't seem to be able to dump out this information effortlessly.

<!--- connect to the .NET object --->
<cfobject
   type=".NET"
   name="v3assembly.obj"
   class="V3Leisure.CABS.WebServices.Examples.CABSExamplesUI.BLL.#Method#"
   assembly="#application.path#\lib\CABSExamplesUI.BLL.dll"
/>


<!--- build up the info to send to the .NET assembly --->
<cfset v3assembly.uri = JavaCast("string","http://www.au.v3travel.com/CABS.WebServices/SearchServiceAdapters.asmx")>
<cfset v3assembly.xml = JavaCast("string",XMLParse(XML))>
<cfset v3assembly.bool = JavaCast("boolean",true)>

<cftry>
   <!--- return the response from the V3 assembly --->
   <cfreturn XmlParse(v3assembly.obj.SendRequest(v3assembly.uri,v3assembly.xml,v3assembly.bool))>
   <cfcatch>
      <cfthrow type="red5" message="It appears that the ColsFusion 8 .NET integration service is not running.">
   </cfcatch>
</cftry>

Once you have hooked up CF to talk with the DLL, it works much like any other object or CFC. Pass in some variables and receive some back. Rinse, and repeat.

The result, if you can't talk to the .NET asmx webservice in a simple XML format, then you need to bypass CF. Java would be able to handle it in most cases, but where the XML was the SOAP body, or the arguments are defined by a DTD, then one of your best options is to make use of the ColdFusion 8 .NET service. Of course it requires that the provider of the service is able to provide you with a .NET component to accept your XML, and wrap it appropriately for you.

Moving to Windows 7 RC, ColdFusion and Apache

I am bored with Vista, and the Windows 7 RC came along at about the right point in time (The annual Windows reinstall was due), so I decided to take the plunge. It's a bit of a risk for primary work machine, so I prepared everything late on Friday, pulled DVD's for software out, and an XP Pro DVD just in case! By and large it was pretty smooth, but here are the issues I did run in to:

Windows installer could not expand set up files

This was an odd error where the installer started, but sat on 0% expanding for an hour or more, then told me that it could not get the files required. A bit of digging turned up that I should try a burn of the RC ISO file on a different machine, or at a different speed. So I tried on my desktop, 8 speed burn with Nero. Resolved!

Apache 2.2.4 could not install

Installing popped up a number of errors, least of all that no httpd.conf and other files were missing, and the httpd service had a permission error. I tried a few suggestions online, but nothing worked. The I used the most up to date version, 2.2.11 at the time of writing, and had no issues at all, Windows let everything pass and it worked first time.

ColdFusion 8

Great news – no issues here, worked first time.

In General, it's a pretty good experience, I like the sleeker taskbar and how it hangs together, I am only on day 2 of using it, so that may change.

Installing coldFusion 8 on IIS7 in Windows 2008 Server

Having ColdFusion run on the new Windows Server 2008 server under IIS 7 is pretty easy, however you have to have the right components installed.

Windows 2008 uses lots of routines from Vista, so installs are really easy, and in this version, instead of installing everything, and then disabling the features, 2008 simpy doesnt install them.

This is nice to see, we now get a screen that asks you to select the features you wish to use on this server. Tick the boxes for IIS and you have a website server.

To get ColdFusion running on the same machine, you need to do the following:

  • Install 2008 server
  • Add the Web Server (IIS) role
  • Select ISAPI Filters
  • Select IIS 6 Management Compatability

Restart IIS and Install ColdFusion as normal. Everything should be working just fine.

as famous as I will ever be

I just took a trip around on CVSDude, and had a look at their testimonials page. We use them for source control, outsourcing it is so much easier than doing it at work or home your self, and they have excellent rates.

Anyhow - I noticed that my quote, made while at a small (but excellent) web shop in Sydney (www.red5.com.au) has been placed at the top of the page amongst the likes of the BBC and Stanford University.

Guys, once again - thanks a lot, you are really providing a wonderful service. If you want to try it out too check out CVSDude (!Affiliate Link!) for some awesome Subversion Source Control Hosting.

Monitoring Java under the Coldfusion hood

We are about to upgrade our ColdFusion 7 servers to 8 Enterprise, and that's hugely exciting, but another story. Coldfusion 8 enterprise comes with the Performance monitor, a Flex based app that is rolled into the CF administrator with access to the CFC's too if you don't like the app Adobe built.

However if you aren't on Enterprise, or on an earlier version of ColdFusion then you don't get this kind of cool monitoring built in. I just had a really interesting read of Using JConsole to monitor ColdFusion's JVM by Dan G. Switzer, and how he hooked up JConsole to CF. I will be giving this a go because we still run a couple of ColdFusion 7 standard servers.

Other choices you have are some commercial products like Fusion ReactorSeeFusion

Filtering your traffic from Google Analytics - the better way

I have been working hard on a new site, and having put adwords up I no longer want to see my hits on the Google Analytics reports because it all just gets in the way.

Analytics gives you 2 ways of excluding traffic using the filters. The first is by IP Address, and the second is to set a cookie with a predetermined value, and filter on it.

You can use the Google Analytics regular expression generator to help you create an IP address filter. This generator can convert one IP address to a simple regular expression, or it can generate a regular expression to match a range of IP addresses.

IP Address is all very well, but what if you use a number of different machines, at home / work / airport etc? Well - setting a cookie is a good way of doing it. So far though all the tutorials I have seen suggest making a blank page, and adding some code to it to set the cookie. Why?

[More]

IIF DE difference between ColdFusion 7 and 8

We just struck this problem because our developers use ColdFusion 8 on their local machines, then we deploy on ColdFusion 7. This is so we can fully test our apps on 8 before rolling it to production.

We don't really run into any issues, but here is one I just found. This issues is a line of code in a form tag that decides whether to launch java script validation code on submit or not, depending on the calling page.

[More]

JRun 4 updater 7 released

Good news if you run on one of the previously unsupported platforms or webservers.

Now JRun supports

  • JDK 1.6
  • Windows Vista
  • Mac OSX 10.4
  • 64 bit support on solaris
  • IIS 7
  • Apache version 2.2.x
  • SunOne Webserver 7

As far as general performance the updater release notes claim to have improved performance when web clustering up to 20 times.

Go read the release notes and download it here.

A short history of ColdFusion

I just a trip down memory lane reading this article from Adobe's coprorate intranet, kindly reproduced by Damon Cooper for the rest of the world to read.

Thanks Damon!

I occasionaly play with other languages, most recently PHP and life is so much harder to get started, making a database call is not easy, and error reporting - oh don't get me started.

Long live ColdFusion and long may she continue to be the best!

Using Smartermail Web Services and API to create domains with ColdFusion

We have moved our email services in house over to SmarterMail because of its history, power and flexibility. We used to use MailEnable, and although we like supporting Aussie companies, Smartermail is just that bit more mature.

Now to make it easy on clients and ourselves, we have minimised the amount of knowledge required to set up new domains, and by adding this code into out intranet, its now simply a case of clicking a button to have the clients domain added, and have the details available ready to hand out. Then we simply hook up the DNS and MX records and we are off!

[More]

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.001.