在IIS上使用WCF服务(使用WAS)进行nettcp绑定的问题? [英] Problems with hosting WCF service on IIS (using WAS) for nettcp bindings?

查看:75
本文介绍了在IIS上使用WCF服务(使用WAS)进行nettcp绑定的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的WCF服务,并通过创建一个新网站将其托管在IIS中。在Web.config文件中,我提供了http和net tcp的绑定。我创建了一个控制台客户端并添加了服务引用它在客户端配置中生成两个绑定 - 用于http和用于tcp。当我尝试使用tcp调用服务时,我收到此错误 -



mscorlib中出现未处理的System.ServiceModel.EndpointNotFoundException类型异常。 dll其他信息:net.tcp://computername/Service.svc上没有可以接受该消息的端点。这通常是由不正确的地址或SOAP操作引起的。



当我使用Http端点运行时(意味着我在我的客户端使用Http端点),它工作良好。



我的网站Web.config文件看起来像



I created a simple WCF service and hosted it in IIS by creating a new website. In Web.config file,I am providing bindings for http and net tcp. I created a console client and adding service reference. It generates two binding in client config - for http and for tcp. When I try to invoke the service using tcp, I get this error -

An unhandled exception of type 'System.ServiceModel.EndpointNotFoundException' occurred in mscorlib.dll Additional information: There was no endpoint listening at net.tcp://computername/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action.

when I run using Http endpoint(means I use Http endpoints in my client), it works fine.

My website Web.config file looks like

<system.serviceModel>
<bindings>
  <netTcpBinding>
    <binding name="NewBinding0" portSharingEnabled="true">
      <security mode="None"  />
    </binding>
  </netTcpBinding>
</bindings>
<services>
  <service behaviorConfiguration="My" name="WCFServiceOM.Service1"> <!--  the service name must match the configuration name for the service implementation. -->
    <endpoint address="" binding="basicHttpBinding" contract="WCFServiceOM.IService1"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    <endpoint  binding="netTcpBinding" bindingConfiguration="NewBinding0" contract="WCFServiceOM.IService1" />
    <endpoint address="mexOM" binding="mexTcpBinding" contract="IMetadataExchange"/>
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:8087/Service1" />
        <add baseAddress="http://localhost:7777/Service1"/>
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="webBehanior">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="My">
      <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>





我的客户App.Config看起来像





And my client App.Config look like

<configuration>
<startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IService1" />
        </basicHttpBinding>
        <netTcpBinding>
            <binding name="NetTcpBinding_IService1">
                <security mode="None" />
            </binding>
        </netTcpBinding>
    </bindings>
    <client>
        <endpoint address="http://computername:7777/Service.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
            contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
        <endpoint address="net.tcp://computername/Service.svc" binding="netTcpBinding"
            bindingConfiguration="NetTcpBinding_IService1" contract="ServiceReference1.IService1"
            name="NetTcpBinding_IService1" />
    </client>
</system.serviceModel>





请帮助。非常感谢你提前



我尝试过:



我正在使用Windows 10操作系统,安装了IIS 10.0和WPAS \ AS(Windows进程激活服务)。我已经在Windows功能的.Net框架中启用了'HTTP激活,TCP激活。并修改了IIS服务器设置以包含net tcp。



Please Help. Thank you so much in advance

What I have tried:

I am using Windows 10 OS, IIS 10.0 and WPAS\WAS (Windows Process Activation Service) are installed. I already enabled\checked HTTP Activation, TCP Activation in .Net framework in Windows features. And modified IIS server settings to include net tcp.

推荐答案

请参阅以下URL并让我知道它有效。





[ NET TCP Configuaration ]
Please refer below URL and let me know it works.


[NET TCP Configuaration]


这篇关于在IIS上使用WCF服务(使用WAS)进行nettcp绑定的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆