I have a Sharepoint solution with a WCF Service and a simple get method that returns a "Hello world". When making the request however, it doesn't return anything and I don't get any error either.

Any idea what could be causing this?

I am making the request in this form: http://myServer/_vti_bin/Service1.svc/helloworld

This is my web.config:

<?xml version="1.0"?>

<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<behavior name="Service1ServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
<behavior name="jsonBehavior">
<webHttp />
<service name="BAServiceMap.Service1"  behaviorConfiguration="Service1ServiceBehavior">
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="jsonBehavior" contract="BAServiceMap.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <add binding="basicHttpsBinding" scheme="https" />
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>

  • do you see the wsdl when you enter that url of the webservice in the browser? – Ola Nov 10 '16 at 14:24
  • yes, I see the wsdl – sallysway Nov 10 '16 at 14:51
  • Have a look at the article in my answer – HarryB Nov 11 '16 at 10:22
  • I created a new service using the MultipleBaseAddressWebServiceHostFactory and it works fine. Cheers :) – sallysway Nov 11 '16 at 12:14

Assuming that you are on SharePoint 2013- I had to create a custom WCF service as well and there is good guidance for doing that in this article

You will not need to rely on a web.config file for your service because in your .svc file the use of the SharePoint-specific MultipleBaseAddressWebServiceHostFactory replaces the need to specify endpoint configurations in a web.config.

For Example your .svc will look like this:

<%@ ServiceHost Language="C#" Debug="true"
    Service="Barkes.Services.Presidents.PresidentsService, $SharePoint.Project.AssemblyFullName$"
    Microsoft.SharePoint.Client.ServerRuntime, Version=, Culture=neutral,
    PublicKeyToken=71e9bce111e9429c" %>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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