Может быть, это поможет.
Услуга:
namespace Application.Service
{
[ServiceBehavior(UseSynchronizationContext = false,
ConcurrencyMode = ConcurrencyMode.Multiple,
InstanceContextMode = InstanceContextMode.PerCall),
AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class VendorService : IVendorService
{
public List<Vendor> RetrieveMultiple(int start, int limit, string sort, string dir)
{
//I don't do any manual serialization
return new Vendor();
}
}
}
Контракт:
[ServiceContract(Namespace = "Application.Service.Contracts")]
public interface IVendorService
{
[OperationContract]
[WebInvoke(ResponseFormat=WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
List<Vendor> RetrieveMultiple(int start, int limit, string sort, string dir);
}
В моем файле Svc есть только эта строка:
<%@ ServiceHost Service="Application.Service.VendorService" %>
Web.config
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<behaviors>
<endpointBehaviors>
<behavior name="jsonBehavior">
<enableWebScript />
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="DefaultServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<service behaviorConfiguration="DefaultServiceBehavior" name="Application.Service.VendorService">
<endpoint behaviorConfiguration="jsonBehavior" address="" binding="webHttpBinding" contract="Application.Service.Contracts.IVendor" />
</service>