Trebor
Trebor

Reputation: 813

The Service attribute value in the ServiceHost directive cannot be found

Okay, I've spent the day looking at this error and all of the posts re, but I still can't seem to find where I've gone wrong. I can communicate with the web service find from an external web service client but I cannot browse the .svc file from within VS or from IIS. I'm publishing to a mapped drive on IIS 6 server, .NET 4.0.

Any help would be greatly appreciated.

Web.config

<services>
      <service name="BiteSizeLearningWS.TranscriptService">

        <endpoint address=""
                  binding="wsHttpBinding"
                  contract="BiteSizeLearningWS.iServiceInterface" />


      </service>
    </services>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
      </serviceHostingEnvironment>
      <standardEndpoints>
          <webHttpEndpoint>
              <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false" defaultOutgoingResponseFormat="Json" faultExceptionEnabled="false"></standardEndpoint>
          </webHttpEndpoint>
      </standardEndpoints>
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

Service.svc

<%@ ServiceHost Service="BiteSizeLearningWS.TranscriptService" %>

IserviceInterface.cs

namespace BiteSizeLearningWS
{
    [ServiceContract]
    public interface iServiceInterface
    ...

Upvotes: 2

Views: 13485

Answers (1)

Trebor
Trebor

Reputation: 813

Solved. My mistake was that the classname that implemented the service interface did not match my service name in my svc file. I didn't realize that they had to match.

I.e. My service name was:

<%@ ServiceHost Service="BiteSizeLearningWS.TranscriptService" %>

But my implementation was:

public class TranscriptServiceLibrary : iServiceInterface

Rather than

public class TranscriptService : iServiceInterface

Sorry, everyone. I obviously didn't include the one file that everyone needed to determine the problem. Thank you for all of your input.

Upvotes: 2

Related Questions