简体   繁体   中英

WCF via IIS problem IP address

I made a WCF Service on Duplex Protocol. It's works correctly and fine. But I have only one small problem:

here is a IP string where can I start an test it: http://localhost:5659/Service.svc

But when I choose my real IP address on my local machine (where localhost existed): http://93.4.18.3:5659/Service.svc

I can't connet yet. Also I can't connect from other addresses using my real IP address. May be something wrong in my web.config ?

Btw - my firewall if switched off.

Here is my config:

<extensions>
  <bindingElementExtensions>
    <add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexElement, System.ServiceModel.PollingDuplex" />
  </bindingElementExtensions>
</extensions>
<behaviors>
  <serviceBehaviors>
    <behavior name="GameStreamServiceBehavior">
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentSessions="2147483647" />
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <customBinding>
    <binding name="pollingDuplexBinding">
      <binaryMessageEncoding />
      <pollingDuplex maxPendingSessions="2147483647" maxPendingMessagesPerSession="2147483647" inactivityTimeout="02:00:00" serverPollTimeout="00:05:00" />
      <httpTransport />
    </binding>
  </customBinding>
</bindings>
<services>
  <service name="WcfServer.Service" behaviorConfiguration="GameStreamServiceBehavior">
    <endpoint address="" binding="customBinding" bindingConfiguration="pollingDuplexBinding" contract="WcfServer.IService" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>

You should check the Site bindings in IIS. It is possible that the HTTP binding on port 5659 is configured for a specific host header ("localhost") or a specific IP address (not 93.4.18.3) only. That would explain the behavior you're getting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM