Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

"Endpoint not found" on Creating a Custom WCF Service in SharePoint Foundation 2010

$
0
0

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 :

1. http://social.technet.microsoft.com/Forums/sharepoint/en-US/eddc83c6-f1c7-49c0-9600-905cc36cbc2d/wcf-service-with-multiplebaseaddressdataservicehostfactory-used-shows-endpoint-not-found?forum=sharepointdevelopment

2. http://social.technet.microsoft.com/Forums/sharepoint/en-US/c1a2fb11-567c-46f7-8977-efd22d630980/why-i-am-getting-error-of-end-point-not-found-for-multiplebaseaddresswebservicehostfactory-while

3. http://stackoverflow.com/questions/12897620/endpoint-not-found-wcf-web-service

4. http://sharepoint.stackexchange.com/questions/45567/wcf-service-endpoint-not-found-but-service-operations-work-ok

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" %>


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>