Configure WCF for Legacy ASMX Clients

The nice thing about WCF is its ability to reach all types of clients, including those set up for communication with a traditional ASMX web service. In many cases, those clients reference a URL ending with an .asmx extension, and it’s not always practical to re-configure clients to use a WCF service that ends with .svc. It would be great if you could configure a WCF service with a basic http binding to respond to requests ending with .asmx.

There is quite good support for this scenario in WCF, and here is a blog post describing how to change web.config:
http://blogs.msdn.com/wenlong/archive/2007/09/18/how-to-use-asmx-extension-to-handle-wcf-requests.aspx

The key here is to specify the WCF ServiceBuildProvider to the .asmx extension, which enables you to create a WCF service file that includes a ServiceHost directive, but end it with .asmx instead of .svc. Note that if you are running IIS is ASP.NET compatibility mode, you’ll also want to change the HttpHandler for .asmx to the WCF HttpHandler. You can download a sample project here.

About Tony Sneed

Sr. Software Solutions Architect, Hilti Global Application Software
This entry was posted in Technical. Bookmark the permalink.

2 Responses to Configure WCF for Legacy ASMX Clients

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.