Request Response ServiceLayer

By Deathraven on Friday 4 December 2009 11:58 - Comments (9)
Categories: Agatha, Software Development, WCF, Views: 5.349

For s short while now i have been involving myself with the open source project Agatha. Originally developed by Davy Brion for use in the company he works at, his company now graciously allowed Davy to open source it.

Read more »

WCF Service as asp.net webservice

By Deathraven on Friday 4 September 2009 10:12 - Comments are closed
Categories: Asp.Net, Software Development, WCF, Views: 1.929

I've been playing around with WCF again lately and i keep being impressed with the relative ease of implementation and simplicity it offers.
Normally when u host a wcf service in IIS. You setup a asp.net application, add a virtual directory and then add a svc file containing something along the lines off:


code:
1
<%@ServiceHost Service="MyServiceNamespace.MyService" %>



However, what if u want to expose it as a asp.net webservice?, or in other words, as a .asmx.

The following code is for enabling a asp.net app to host your WCF service as a asmx webservice.

XML:
1
2
3
4
5
6
7
8
9
10
11
12
<system.web>
<compilation debug="true">
        <buildProviders>
          <remove extension=".asmx"/>
          <add extension=".asmx" type="System.ServiceModel.ServiceBuildProvider,
               System.ServiceModel,
               Version=3.0.0.0,
               Culture=neutral,
               PublicKeyToken=b77a5c561934e089"/>
        </buildProviders>
      </compilation>
</system.web>


Thats it. Besides doing the usual stuff when hosting a wcf service in IIS. These lines added to the web.config are all it takes to mask your wcf service as a asp.net webservice.