远程服务器中的wsdualhttpbinding

时间:2013-09-27 14:24:17

标签: wcf web-config app-config wsdualhttpbinding

我们正在使用WCF服务开发应用程序。

我们的客户端应用程序是桌面WPF应用程序,我们使用wsdualhttpbinding协议与服务器通信。一切都在我们的本地机器上运行良好但是当我们将它部署到远程服务器时它不起作用。应用程序不会抛出任何异常,但我们在服务器的日志中看到请求被接受但我们没有得到任何响应。

我们认为应用程序工作正常,因为在本地计算机上工作,因此问题出在.config文件中。

我们的web.config:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, 
                     EntityFramework, Version=5.0.0.0, Culture=neutral,
                     PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
        </configSections>
        <appSettings>
            <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
        </appSettings>
        <system.web>
           <compilation debug="true" targetFramework="4.5" />
           <httpRuntime targetFramework="4.5" />
        </system.web>
        <system.serviceModel>
            <bindings>
                <wsDualHttpBinding>
                    <binding name="WSDualHttpBinding_IReceiverController" closeTimeout="00:00:15"
                      openTimeout="00:00:15" receiveTimeout="00:00:15" sendTimeout="00:00:15"
                      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:00:15" />
                        <security mode="Message">
                            <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
                </security>
            </binding>
            </wsDualHttpBinding>
        </bindings>
        <services>
            <service name="Namespace.Service1" behaviorConfiguration="svcbh">

                <endpoint name="duplexendpoint" address="" binding="wsDualHttpBinding" contract="Namespace.IService1" bindingConfiguration="WSDualHttpBinding_IReceiverController">

                </endpoint>
                <endpoint name="MetaDataTcpEndpoint" address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />       

            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="svcbh">
                    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
   </system.serviceModel>
   <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
            <directoryBrowse enabled="true" />
   </system.webServer>
   <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
   </entityFramework>
</configuration>

这是我们的app.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
    </configSections>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
            <bindings>
                    <wsDualHttpBinding>
                        <binding name="duplexendpoint" clientBaseAddress="http://192.168.1.1">
                                <reliableSession inactivityTimeout="00:00:15" />
                        </binding>
                    </wsDualHttpBinding>
            </bindings>
            <client>
                    <endpoint address="http:////192.168.1.1/Service1.svc" binding="wsDualHttpBinding"
                            bindingConfiguration="duplexendpoint" contract="Namespace.IService1"
                            name="duplexendpoint">
                            <identity>
                                    <servicePrincipalName value="host/SERVIDORWEB" />
                            </identity>
                    </endpoint>
            </client>
        </system.serviceModel>
        <runtime>
            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
                <dependentAssembly>
                        <assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
                </dependentAssembly>
            </assemblyBinding>
        </runtime>
</configuration>

提前谢谢!!!

0 个答案:

没有答案