I am using WCF REST Start kit to build a RESTFul service. I defined a service like this:
namespace MyNS {
[ServiceBehavior(IncludeExceptionDetailInFaults = true,
InstanceContextMode = InstanceContextMode.Single,
ConcurrencyMode = ConcurrencyMode.Single)]
[AspNetCompatibilityRequirements(
RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MyService : MyCollectionServiceBase, IMyCollectionServiceBase
{...}
}
MyCollectionServiceBase and IMyCollectionSeviceBase are defined like this:
namespace MyNS.Contract {
[ServiceContract]
public interface IMyCollectionServiceBase<TItem> where TItem : class
{...}
// COllectionServiceBase is an abstract class in
// Microsoft.ServiceModel.Web.SpecializedServices
public abstract class MyCollectionServiceBase<TItem> :
CollectionServiceBase<TItem>
where TItem : class
{...}
}
and here is a section of service in my Web.config
<serviceBehaviors>
...
<behavior name="MyNS.MyService1Behavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
...
<service behaviorConfiguration="MyNS.MyService1Behavior"
name="MyNS.MyService1">
<endpoint address="" binding="wsHttpBinding"
contract="MyNS.IMyService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
When I test my service by using "http://localhost:1290/MyService.svc/", I got error message saying:
The contract name 'MyNS.Contract.IMyCollectionServiceBase' could not be found
in the list of contracts implemented by the service 'MyService'.
I am not sure if the endpoint is not matched or something is missing?