Blog Stats
  • Posts - 52
  • Articles - 0
  • Comments - 1
  • Trackbacks - 12

 

WCF and ASMX compatibility

I made some research about this topic and I found this post from Matt Tavis.

Basically we need to define our service contract in the following manner to support WCF and ASMX:

namespace ServiceContracts

{

    [ServiceContract]

    [WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1,EmitConformanceClaims=true)]

    public interface IEmployeeManager

    {

        [OperationContract]

        [WebMethod]

        Employee getEmployee(int employeeId);

    }

}

The System.Web.Services.WebServicesBindingAttribute class is used to specify a binding that describe things like the service location, its namespace, conformance to the WS-I Basic Profile, etc.

In the .NET Framework 2.0, this attribute and the WebMethod attribute may now be applied to interfaces.

So we can have Interface-Based Service Contracts that target ASMX also.

 

Pablo


Feedback

No comments posted yet.


Post a comment





 

 

 

Copyright © Pablo Galiano