我正在尝试设置一个wcf服务,以便在IIS 7上使用net.tcp。
下面是我遇到的错误:
没有侦听net.tcp://127.0.0.1:8000/ListingService可以接受消息的端点。这通常是由不正确的地址或SOAP操作造成的。有关更多细节,请参见InnerException (如果存在)。
下面是我从客户端调用的代码:
using (var client = new ListingServiceClient("NetTcpBinding"))
{
client.Test();
client.Close();
}这是我的服务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>这是我的客户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>有什么想法吗?
发布于 2011-01-28 00:15:49
此配置将无法在IIS/WAS中运行。在IIS中托管时,您需要.svc文件(或WCF 4中基于配置的激活),端点的地址总是VirtualDirectoryPath + SvcFile +端点配置中指定的相对地址。在端点配置中设置绝对地址是为了自我托管。
https://stackoverflow.com/questions/4820172
复制相似问题