I'm currently developing a custom wcf rest webservice on sharepoint 2010, but I keep getting the message Endpoint not configured Im deploying the webservice on a _ISAPI solution folder. Here's the code.
First, The service markup
<%@ServiceHost Language="C#" Debug="true"
Service="MS.InformationManagement.Services.VoBoService, $SharePoint.Project.AssemblyFullName$"
Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressWebServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Now, the Service contract:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
using MS.InformationManagement.DAL.MobileDTOs;
namespace MS.InformationManagement.Services.WCFServiceContracts
{
[ServiceContract]
public interface IVoBoService
{
[OperationContract]
[WebGet(RequestFormat= WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate= "/FetchVoBos/pi/{pageIndex}/pz/{pageSize}")]
IEnumerable<VoBoMDTO> FetchVoBos(string pageIndex, string pageSize);
[OperationContract]
[WebGet(RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "/Answer/{voboId}/ou/{ouput}/c/{comments}")]
void Answer(string voboId, string ouput, string comments);
}
}
Now The service class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.Services.WCFServiceContracts;
using MS.InformationManagement.DAL.MobileDTOs;
using System.ServiceModel.Activation;
namespace MS.InformationManagement.Services
{
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class VoBoService: IVoBoService
{
public IEnumerable<VoBoMDTO> FetchVoBos(string pageIndex, string pageSize)
{
throw new NotImplementedException();
}
public void Answer(string voboId, string ouput, string comments)
{
throw new NotImplementedException();
}
}
}
Finally an entry on the Web.config File:
<system.serviceModel>
<services>
<service name="MS.InformationManagement.Services.VoBoService" behaviorConfiguration="RestBehavior">
<endpoint address="" binding="basicHttpBinding" contract="MS.InformationManagement.Services.WCFServiceContracts.IVoBoService" behaviorConfiguration="web" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="RestBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
Am I missing something?