2

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?

3
  • Did you look at this question: sharepoint.stackexchange.com/questions/45567/… ? And did you test your service methods directly? Also, you can make services without having to edit web.config
    – eirikb
    Commented Sep 16, 2012 at 20:50
  • Yes I did saw the question, and I'm testing the methods using javascript/calling them through the browser's url. I still get the endpoint not found error.
    – Jaime
    Commented Sep 16, 2012 at 20:54
  • Have you tried setting up something very simplified, perhaps like this: ranaictiu-technicalblog.blogspot.no/2011/03/… ?
    – eirikb
    Commented Sep 16, 2012 at 21:01

1 Answer 1

2

Ok found the issue. Removed the endopoint from the webconfig file. So now my system.servicemodel section looks like this

<system.serviceModel>
<services>
  <service name="MS.InformationManagement.Services.VoBoService" behaviorConfiguration="RestBehavior"/>
</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" />

Hope this helps if any other has the same issue. Happy coding

1
  • hello, can you please provide a link to implement this rest service in sharepoint?may be a step by step guide?
    – dasarp
    Commented Oct 25, 2016 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.