0
votes

I'm trying to create a WCF service that can be accessed over HTTP and Named Pipes. After changing the default configuration (I added the netNamedPipeBinding and endpoint), I can't consume the WCF service anymore. Something has to be wrong with my Web.config.

Edit:

I forgot to post the error I am getting:

Error: Cannot obtain Metadata from http://localhost/WebServices/CreateContent.svc

If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.

Web.config

<system.serviceModel>
    <services>
      <service name="Application.WebServices.CreateContent" behaviorConfiguration="behave">
        <endpoint binding="basicHttpBinding" bindingConfiguration="basicHttpBinding"
          name="basicHttp" contract="Application.WebServices.ICreateContent" />
        <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="mexHttpBinding"
          name="mexHttp" contract="IMetadataExchange" />
        <endpoint binding="netNamedPipeBinding" bindingConfiguration="netNamedPipeBinding"
          name="netNamedPipe" contract="PTUmbraco.WebServices.ICreateContent" />
        <endpoint binding="mexNamedPipeBinding" bindingConfiguration="mexNamedPipeBinding"
          name="mexNamedPipe" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/WebServices/CreateContent.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="behave">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpBinding" maxBufferSize="10485760" maxReceivedMessageSize="10485760" />
      </basicHttpBinding>
      <netNamedPipeBinding>
        <binding name="netNamedPipeBinding" />
      </netNamedPipeBinding>
      <mexHttpBinding>
        <binding name="mexHttpBinding" />
      </mexHttpBinding>
      <mexNamedPipeBinding>
        <binding name="mexNamedPipeBinding" />
      </mexNamedPipeBinding>
    </bindings>
  </system.serviceModel>
1
What error are you getting?Stormhashe

1 Answers

0
votes

I'll try to answer as best as I can, since you didnt post what error you are getting.

Did you check if your Net.Pipe Listener Adapter service is up and running?

enter image description here

If the error you are getting is "the message could not be dispatched because the service at the endpoint address is unavailable for the protocol of the address", them you might have to use the ServiceModel Registration Tool from microsoft, by running this command on your framework's folder:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>ServiceModelReg.exe -r

I've already had a couple of problems with WCF, and like you, thought it was a config problem, but your config seems to be ok, so you might give those a try.

here's more info about that ServiceModel tool:

https://forums.asp.net/t/2039313.aspx?WCF+TCP+Binding+Hosted+in+IIS+7+endpoint+address+is+unavailable+for+the+protocol+of+the+address