Pablo Galiano : WCF and ASMX compatibility

Subscriptions

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

News

Subscribe to Pablo Galiano by Email

Post Categories

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)]

    publicinterfaceIEmployeeManager

    {

        [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

posted on Friday, February 24, 2006 1:21 PM by pga