Previously, there was no interface involved. The contract attribute of the endpoint defined in Web.config is directly pointing to the name of service itself. For example,
<system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="Shipment.Order.WebAspNetAjaxBehavior"> <enableWebScript /> </behavior> .... <service name="Shipment.Order"> <endpoint address="" behaviorConfiguration="Shipment.Order.WebAspNetAjaxBehavior" binding="webHttpBinding" contract="Shipment.Order" /> </service> ... </system.serviceModel>
Now, with the interface; the declaration of the endpoint contract is the interface instead of the service itself.
<service name="Shipment.Order"> <endpoint address="" behaviorConfiguration="Shipment.Order.WebAspNetAjaxBehavior" binding="webHttpBinding" contract="Shipment.IOrder" /> </service>
Since the service has been placed into service sometime ago, the change to use interface is not a good idea. It affects a lot of pages that use this service. Instead of making the existing service to implement an interface, I derived a subclass from it so that the subclass inherits whatever its parent has. Then I simply configure an endpoint for this subclass instead of configuring multiple endpoints for the existing service. As a result, it works like a charm!