2014-12-25 11 views
0

WCF Duplex在Azure下無法工作。 在IIS Express下一切正常。 我知道雙工綁定是有問題的,因爲服務器回調,但.... 我已經關閉了我的防火牆。 TCPView(Sysinternals)顯示10到12個數據包被客戶端發送/接收,然後它只是死...沒有任何反應。 我設置爲10分鐘所有超時我可以。wsDualHttpBinding在Azure下部署時無法工作

請看我下面的配置文件。

服務器配置:

<system.serviceModel> 
<services> 
    <service behaviorConfiguration="MexBehaviour" name="MySrvc"> 
    <endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBinding" 
     name="wsDualEndpoint" bindingName="wsDualHttpBinding" contract="IMySrvc" /> 
    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="mexHttpBinding" 
     name="MexEndpoint" bindingName="mexHttpBinding" contract="IMetadataExchange" /> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://srvc.azurewebsites.net/MySrvc.svc" /> 
     </baseAddresses> 
     <timeouts openTimeout="00:10:00" /> 
    </host> 
    </service> 
</services> 
<bindings> 
    <wsDualHttpBinding> 
    <binding name="wsDualHttpBinding" openTimeout="00:10:00" sendTimeout="00:10:00" 
     clientBaseAddress="http://xxx.xxx.xxx.xxx:xxx"> 
     <security mode="None"> 
     <message clientCredentialType="None" negotiateServiceCredential="false" /> 
     </security> 
    </binding> 
    </wsDualHttpBinding> 
    <mexHttpBinding> 
    <binding name="mexHttpBinding" /> 
    </mexHttpBinding> 
</bindings> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="MexBehaviour"> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<protocolMapping> 
    <add binding="basicHttpsBinding" scheme="https" /> 
</protocolMapping>  
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 

客戶端配置:

<system.serviceModel> 
    <bindings> 
     <wsDualHttpBinding> 
      <binding name="wsDualEndpoint"> 
       <security mode="None" /> 
      </binding> 
     </wsDualHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://srvc.azurewebsites.net/MySrvc.svc" 
      binding="wsDualHttpBinding" bindingConfiguration="wsDualEndpoint" 
      contract="SrvcRef.IMySrvc" name="wsDualEndpoint" /> 
    </client> 
</system.serviceModel> 
+0

可能相同的問題http://stackoverflow.com/questions/19922710/wcf-wsdualhttpbinding-binding-on-windows-azure-vm – dotnetstep

+0

在這一點上,我想問:有沒有人有一個WCF wsDualHttpBinding服務實際上在遠程主機(如Azure)中工作?我只是在AWS雲上的EC2計算機上部署了我的CLIENT(不是服務,仍在Azure上),只是爲了確保問題不在我的開發機器中,並且行爲完全相同,它不起作用。 ...有沒有人得到實際上在遠程主機上工作的wsDualHttpBinding?請告訴我。這是一個YES或NO的問題。謝謝。 – jsanalytics

回答

1

我知道這wsDualHttpBinding沒有通過 「嗅覺測試」 ...... 從Juval Lowy的書「編程WCF服務:掌握WCF和Azure AppFabric服務總線」:

...的WSDualHttpBinding大多是不可用的,因爲它幾乎是不可能的隧道通過分離來自客戶端的服務,需要尋找一個特定的Web服務器,各種型號的溝通障礙,使這是不切實際的。

我只需使用NetTcpBinding的代替.... 你只需要獲得IIS使用TCP協議的工作解決了我的問題。 有很多文章解釋如何去做。 這裏有一個: http://msdn.microsoft.com/en-us/library/ms731053.aspx

乾杯。

相關問題