Welcome!

Microsoft Cloud Authors: Andreas Grabner, Stackify Blog, Liz McMillan, David H Deans, Automic Blog

Related Topics: Microsoft Cloud

Microsoft Cloud: Article

ColdFusion and .NET Integration

Beyond Web services

As both a .NET programmer and ColdFusion developer, I always wondered how I could leverage the world of .NET in ColdFusion. Both platforms come with powerful features and using them together might be a wonderful friendship, if one could only make them cooperate. There are two worlds out there and none of them is an island.

Apart from this, and starting with Windows Vista, Microsoft will include the last incarnation of the .NET Framework in its flagship operating system, with all the bells and whistles that come with it. For those who like their ColdFusion environment hosted on a Windows server, this means they'll always have all the features provided in the .NET platform at hand. Even if a switch to Vista won't be an option in the near future for current projects, you may still wonder how you can put them to work for your ColdFusion application.

The promise of the next version of ColdFusion (code named "Scorpio" and due out later this year) is that it will support .NET natively. This also means that access to this platform will be of interest to ColdFusion developers, in the future anyway. Still, apart from the ability to use .NET objects directly from CFML, there are other ways of making ColdFusion and the .NET Framework talk to each other.

Here we're going to explore some of these methods. This article assumes a basic knowledge of event gateways and how to use external objects from ColdFusion (Web services and COM objects), as well as a fair understanding of the .NET architecture. On the one hand, there's your world, ColdFusion. On the other side is .NET. So what are our bridging options?

Consuming Web Services
Of course, the first answer that comes to mind is to build and deploy ASP.NET Web services. You don't have to know the intricate details of the Simple Object Access Protocol (SOAP) or Web Services Definition Language (WSDL) to successfully write such a component in .NET (or ColdFusion for that matter) - at least for most developing tasks. The .NET Framework will take care of all details for you.

For example, the class that will implement the methods exposed by a Web service doesn't even need to be derived from the Web Service class found in .NET, although doing so will provide the service with direct access to different common ASP.NET objects (session state, application state, request context, and so on). On the other hand, the methods that should be public for the Web service must be decorated with the WebMethod attribute. Not all methods should be decorated this way, effectively making those methods private to the implementation of the component.

Consuming a .NET Web service from ColdFusion is just a matter of using CFOBJECT or CreateObject, depending on the developer's preferences. Care should be taken when defining method parameters and return values so that both platforms understand each other (for example, you can't pass a ColdFusion structure to .NET as is).

Anyway, this road of Web services has already been taken and discussed in many articles about ColdFusion and .NET. I won't go further than that and start exploring other interoperability options.

Talking .NET 3.0: Windows Communication Framework Services
In the last release of the .NET Framework, Microsoft complemented the previous version with a few interesting components. In fact, .NET 3.0 is the old 2.0 platform; the Common Language Runtime (CLR) that sits at the base of the framework hasn't been upgraded at all. On top of it there are now four main technologies written entirely in .NET 2.0: Windows Presentation Foundation (WPF), Windows Workflow Foundation (WF), Windows CardSpace (WCS), and Windows Communication Framework (WCF), which is the focus here.

There are many technologies that are meant for making two applications talk to each other. Depending on the project requirements, one can choose between named pipes, message queue-based communication, peer-to-peer protocols, and so on, including Web services. The rationale behind WCF is to provide a unifying programming model for all existent communication technologies, at the same time offering the possibility of defining your own custom transport protocol. Instead of trying to learn multiple technologies, a programmer would have to know WCF. All components written according to the WCF model can easily talk to applications exposing their functionality through any protocol.

To expose a class to the outside world through WCF, one must define an interface and decorate it with the ServiceContract attribute, while the methods defined for that interface should be decorated with an OperationContract attribute (the ones that aren't decorated as such won't be exposed at all). The C# example below defines an interface (in WCF speak, a contract) exposing a single operation:

[ServiceContract]
public interface IHello {
    [OperationContract]
    string SayHello(string name);
}

The actual implementation must be provided in a class that derives from this interface. To start the service, several other steps must be followed, such as configuring the service (that is, informing the WCF system about the address where the service will be exposed; the configuration is done in a special XML file called app.config), and hosting it (meaning, running the application - there are also several options here, such as compiling the service as a console application, running it inside IIS, implementing it as a Windows service, and so on).

The good news for a ColdFusion developer is that the WCF components can be configured to act as Web services. From a ColdFusion point-of-view, such a WCF object is just another Web service exposing its functionality via WSDL, thus being accessible through CFOBJECT/CreateObject.


More Stories By Catalin Sandu

Catalin Sandu is a software developer at RomSoft (www.rms.ro) and has 10 years of experience. He is both a Microsoft Certified Professional (on C++ and .NET), and an Advanced ColdFusion MX 7 Developer. Catalin is also a member of the British Computer Society since 2005.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


@ThingsExpo Stories
SYS-CON Events announced today that Cloud Academy named "Bronze Sponsor" of 21st International Cloud Expo which will take place October 31 - November 2, 2017 at the Santa Clara Convention Center in Santa Clara, CA. Cloud Academy is the industry’s most innovative, vendor-neutral cloud technology training platform. Cloud Academy provides continuous learning solutions for individuals and enterprise teams for Amazon Web Services, Microsoft Azure, Google Cloud Platform, and the most popular cloud com...
We build IoT infrastructure products - when you have to integrate different devices, different systems and cloud you have to build an application to do that but we eliminate the need to build an application. Our products can integrate any device, any system, any cloud regardless of protocol," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
In his session at Cloud Expo, Alan Winters, an entertainment executive/TV producer turned serial entrepreneur, presented a success story of an entrepreneur who has both suffered through and benefited from offshore development across multiple businesses: The smart choice, or how to select the right offshore development partner Warning signs, or how to minimize chances of making the wrong choice Collaboration, or how to establish the most effective work processes Budget control, or how to ma...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business - from apparel to energy - is being rewritten by software. From planning to development to management to security, CA creates software that fuels transformation for companies in the applic...
Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists looked at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deliver...
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), provided an overview of various initiatives to certify the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldwide re...
Amazon started as an online bookseller 20 years ago. Since then, it has evolved into a technology juggernaut that has disrupted multiple markets and industries and touches many aspects of our lives. It is a relentless technology and business model innovator driving disruption throughout numerous ecosystems. Amazon’s AWS revenues alone are approaching $16B a year making it one of the largest IT companies in the world. With dominant offerings in Cloud, IoT, eCommerce, Big Data, AI, Digital Assista...
New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists examined how DevOps helps to meet the de...
"When we talk about cloud without compromise what we're talking about is that when people think about 'I need the flexibility of the cloud' - it's the ability to create applications and run them in a cloud environment that's far more flexible,” explained Matthew Finnie, CTO of Interoute, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
No hype cycles or predictions of zillions of things here. IoT is big. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, Associate Partner at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He discussed the evaluation of communication standards and IoT messaging protocols, data analytics considerations, edge-to-cloud tec...
IoT solutions exploit operational data generated by Internet-connected smart “things” for the purpose of gaining operational insight and producing “better outcomes” (for example, create new business models, eliminate unscheduled maintenance, etc.). The explosive proliferation of IoT solutions will result in an exponential growth in the volume of IoT data, precipitating significant Information Governance issues: who owns the IoT data, what are the rights/duties of IoT solutions adopters towards t...
With the introduction of IoT and Smart Living in every aspect of our lives, one question has become relevant: What are the security implications? To answer this, first we have to look and explore the security models of the technologies that IoT is founded upon. In his session at @ThingsExpo, Nevi Kaja, a Research Engineer at Ford Motor Company, discussed some of the security challenges of the IoT infrastructure and related how these aspects impact Smart Living. The material was delivered interac...
The Internet giants are fully embracing AI. All the services they offer to their customers are aimed at drawing a map of the world with the data they get. The AIs from these companies are used to build disruptive approaches that cannot be used by established enterprises, which are threatened by these disruptions. However, most leaders underestimate the effect this will have on their businesses. In his session at 21st Cloud Expo, Rene Buest, Director Market Research & Technology Evangelism at Ara...
When growing capacity and power in the data center, the architectural trade-offs between server scale-up vs. scale-out continue to be debated. Both approaches are valid: scale-out adds multiple, smaller servers running in a distributed computing model, while scale-up adds fewer, more powerful servers that are capable of running larger workloads. It’s worth noting that there are additional, unique advantages that scale-up architectures offer. One big advantage is large memory and compute capacity...
Artificial intelligence, machine learning, neural networks. We’re in the midst of a wave of excitement around AI such as hasn’t been seen for a few decades. But those previous periods of inflated expectations led to troughs of disappointment. Will this time be different? Most likely. Applications of AI such as predictive analytics are already decreasing costs and improving reliability of industrial machinery. Furthermore, the funding and research going into AI now comes from a wide range of com...
Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...
SYS-CON Events announced today that Enzu will exhibit at SYS-CON's 21st Int\ernational Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to focus on the core of their ...
SYS-CON Events announced today that GrapeUp, the leading provider of rapid product development at the speed of business, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market acr...