Hi
I have create a service from url "http://msdn.microsoft.com/en-us/library/office/ff521581(v=office.14).aspx", Followed Step by step instruction.But after deploy it message shows "Endpoint not found".
Already gone throught these links :
3. http://stackoverflow.com/questions/12897620/endpoint-not-found-wcf-web-service
5. http://ranaictiu-technicalblog.blogspot.in/2011/03/sharepoint-2010-create-custom-wcf.html
Nothing working...Is there any sharepoint level setting also required ?
My code Sample
Interface :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Xml;
namespace SharePointBits.Samples.WCFServices
{
[ServiceContract]
public interface ISampleService
{
[OperationContract]
[WebInvoke(UriTemplate = "/GetCurrentWebUrl", Method = "GET", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)]
String GetCurrentWebUrl();
}
}
Class:
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Client.Services;
namespace SharePointBits.Samples.WCFServices
{
[BasicHttpBindingServiceMetadataExchangeEndpoint]
[AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Required)]
public class SampleService:ISampleService
{
public String GetCurrentWebUrl()
{
return SPContext.Current.Web.Url;
}
}
}
svc:
<%@ ServiceHost Language="C#" Debug="true" Service="SharePointBits.Samples.WCFServices.SampleService, SharePointBits.Samples.WCFServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d0b6c90058d16635"CodeBehind="Sample.svc.cs" Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressWebServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>