我在IIS8中有一個WCF服務主機,我想使用net.tcp綁定。IIS8在net.tcp中沒有端點監聽:
我有這樣的配置:
Web.config文件:
<service behaviorConfiguration="MyBehavior"
name="DecryptService.EmailCenterDecryptTCP">
<host>
<baseAddresses>
<add baseAddress="net.tcp://XX.XX.XX.XX:808/VirtualFolder/Service.svc" />
</baseAddresses>
</host>
<endpoint address=""
binding="netTcpBinding"
bindingConfiguration="portSharingBinding"
name="MyServiceEndpoint"
contract="ServiceNamespace.IService">
</endpoint>
<endpoint address="mextcp"
binding="mexHttpBinding"
bindingConfiguration=""
name="MyServiceMexTcpBidingEndpoint"
contract="IMetadataExchange" />
</service>
當我嘗試消耗在同一個機器IIS8具有以下配置服務工作正常:
<client>
<endpoint address="net.tcp://YY.YY.YY.YY:808/VirtualFolder/Service.svc"
binding="netTcpBinding" bindingConfiguration="MyServiceEndpoint"
contract="ServiceReference1.IService" name="MyServiceEndpoint" />
</client>
YY.YY.YY.YY是機器的本地IP,但是當我嘗試使用另一臺機器中的服務時,將YY.YY.YY.YY更改爲機器(ZZ.ZZ.ZZ.ZZ)的外部IP IIS8我得到以下錯誤:
There was no endpoint listening at net.tcp://ZZ.ZZ.ZZ.ZZ/VirtualFolder/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
任何想法? 感謝和我的英語不好對不起
編輯:
我做了運行ServiceHost的替代IIS,並與該配置它的工作原理在互聯網
var svh = new ServiceHost(typeof (Service));
svh.AddServiceEndpoint(typeof (ServiceNamespace.IService), new NetTcpBinding(SecurityMode.None), "net.tcp://serverLocalIp:808");
svh.Open();
Console.WriteLine("SERVER - Running...");
stopFlag.WaitOne();
Console.WriteLine("SERVER - Shutting down...");
svh.Close();
Console.WriteLine("SERVER - Shut down!");
任何想法,什麼是錯用一個控制檯應用程序IIS通過互聯網運行相同的服務?本地工作。 謝謝
但是,如果我在「HTTP,的net.tcp」的空間甚至不應該爲本地調用失敗? – 2013-04-06 00:02:54
我審查了IIS,我有一切正常..問題是,如果我從同一臺機器調用IIS8正在運行(本地主機)的服務一切正常,但是當我調用運行IIS的機器以外的同一服務時,我得到錯誤 – 2013-04-08 08:53:22
聽起來像防火牆,然後阻止你。 – Middas 2013-04-08 14:48:12