1
votes

I'm trying to setup a wcf service to use net.tcp over IIS 7.

Here is the error I get:

There was no endpoint listening at net.tcp://127.0.0.1:8000/ListingService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

Here is the code I call from the client:

using (var client = new ListingServiceClient("NetTcpBinding"))
{
   client.Test();
   client.Close();
}

Here is my services web.config - http://pastebin.com/3S8BZbup

<system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding portSharingEnabled="true">
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="default">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <!--throttle service-->
          <serviceThrottling
            maxConcurrentCalls="10000"
            maxConcurrentSessions="10000" 
            maxConcurrentInstances="10000" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="default" name="Housters.Services.ListingService">
        <endpoint name="TcpEndpoint"
                  address="net.tcp://127.0.0.1:8000/ListingService"
                  binding="netTcpBinding"
                  contract="Housters.Services.IListingService" />
      </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
      <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

And here is my client app.config - http://pastebin.com/YpiAhh46

<system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="NetTcpBinding">
          <security mode="None"/>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint
              address="net.tcp://127.0.0.1:8000/ListingService"
              binding="netTcpBinding" bindingConfiguration="NetTcpBinding"
              contract="ListingServiceProxy.IListingService" name="NetTcpBinding" />
    </client>
  </system.serviceModel>

Any ideas?

1
I should also mention that I have added net.tcp in the iis enabled protocols and have added a binding for net.tcp - "8000:*".Justin
Not sure if this is the problem, but I noticed you don't set the bindingConfiguration property on the "TcpEndpoint" endpoint. nor do you have a name set on the netTcpBinding.vlad
Are we looking at the same code? On the tcp endpoint I'm setting the bindingConfiguration: bindingConfiguration="NetTcpBinding". I'm also setting the name on the netTcpBinding: <binding name="NetTcpBinding">. Let me know if I'm misunderstanding.Justin
configs added - no problems at all....marc_s
I'm confused. what was the cause of the problem? was it that you were not hosting the server correctly? perhaps IIS not getting along with net.tcp, like marc_s suggested?vlad

1 Answers

7
votes

This configuration will not work in IIS/WAS. When hosting in IIS you need .svc file (or configuration based activation in WCF 4) and address of the endpoint is always VirtualDirectoryPath + SvcFile + Relative address specified in endpoint configuration. Setting absolute address in endpoint configuration is for self hosting.