开发者

WCF trying to expose a nettcp endpoint; TCP error code 10061: No connection could be made because the target machine actively refused it

I don't understand what the problem is here. My wsHttpBinding works fine. Here is my configuration. Any help most appreciated.

<?xml version="1.0"?>
<configuration>
  .....
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="DataService.Service1Behavior"
               name="ODHdotNET.DataService">
        <endpoint 
               address="" 
               binding="wsHttpBinding" 
               bindingConfiguration="largeTransferwsHttpBinding"
               contract="ODHdotNET.IDataService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint 
            address="net.tcp://139.149.141.221:8001/DataService.svc" 
            binding="netTcpBinding" 
            contract="ODHdotNET.IDataService"/>
        <endpoint 
            address="mex" 
            binding="mexHttpBinding" 
            contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://139.149.141.221:8000/DataService.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="largeTransferwsHttpBinding2" 
                 maxReceivedMessageSize="5000000" maxBufferPoolSize="5000000">
     开发者_开发知识库     <security mode ="Message">
            <message clientCredentialType="UserName"/>
          </security>
        </binding>
        <binding name="largeTransferwsHttpBinding" 
                 maxReceivedMessageSize="5000000" maxBufferPoolSize="5000000" />
      </wsHttpBinding>
     </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="DataService.Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

edit: I am self-hosting in a Windows Service; I am not using IIS.


do you mean that a WCF client throws this error ? if so: please run the follwing at the command prompt: netstat -ona | find "8001" if this returns data, please post it


You need to add TCP support to your IIS. To enable TCP, MSMQ, or named pipes communication specifically, perform the additional step of configuring support for the associated protocol. For TCP communication, bind the default Web site to a net.tcp port by using the Appcmd command-line utility. Appcmd is an IIS utility that enables you to administer virtual sites, directories,applications, and application pools.

%windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -
+bindings.[protocol='net.tcp',bindingInformation='808:*']

To support the other protocols, run additional commands that enable those protocols for the default Web site. At this point, you have configured the net.tcp protocol at the site level.

%windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/OrderServiceHost"
/enabledProtocols:http,net.tcp

Please look at these for more detail: Extend Your WCF Services Beyond HTTP With WAS

Hosting WCF Services in Windows Activation Service


Make sure the port is open in windows firewall


Make sure your host is running when you invoke methods in client application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜