我遵循了这个教程(至少基于我的WCF,因为我需要同样的工作):http: //www.eggheadcafe.com/tutorials/wcf/b5ada8df-58c5-492f-b368-457b3a4f137c/notify-client-应用-使用的WCF,callbacks.aspx
它在我的电脑上工作得很好,但我需要通过互联网使用它.在尝试这样做时,我听说(通过互联网)最好使用netTcpBiding.
我将拥有一台能够了解在线客户数量的服务器.我想在服务器上的IIS上使用WFC服务,并使用Windows服务并通知它.我需要回调因为服务器有时必须能够在客户端上执行一些命令.
如果有人能帮助我,我会很高兴.
提前致谢,
编辑:
让自己明确:我无法让它在互联网上运作.你们能告诉我如何更改配置(Web.config e App.config)以使用netTcpBinding并通过互联网工作?
再次感谢,
编辑2:
我的WCFServiceApplication中的Web.config是:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IPCWatcherWCFService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="TiT.PCWatcher.Server.WCFService.Services.PCWatcherWCFServiceBehavior" name="TiT.PCWatcher.Server.WCFService.Services.PCWatcherWCFService">
<endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IPCWatcherWCFService" contract="TiT.PCWatcher.Server.WCFService.Interfaces.IPCWatcherWCFService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" …Run Code Online (Sandbox Code Playgroud)