.net WCF服务参考Can';无法通过HTTPS进行更新

.net WCF服务参考Can';无法通过HTTPS进行更新,.net,visual-studio,web-services,wcf,https,.net,Visual Studio,Web Services,Wcf,Https,我已经有一些WCF服务(由WinForms应用程序使用)在IIS下运行了一段时间,没有任何问题。我只是想重新访问它们并添加一些新功能,现在我遇到了一个问题,当我尝试在VisualStudio中更新服务引用时,这个问题首先变得很明显 在现有服务引用上单击鼠标右键,然后在Visual Studio中更新服务引用会引发错误: 下载“”时出错。请求失败,HTTP状态为400:请求错误。元数据包含无法解析的引用:(等…) 如果我打开https://www.test.com/WCF/MyService.sv

我已经有一些WCF服务(由WinForms应用程序使用)在IIS下运行了一段时间,没有任何问题。我只是想重新访问它们并添加一些新功能,现在我遇到了一个问题,当我尝试在VisualStudio中更新服务引用时,这个问题首先变得很明显

在现有服务引用上单击鼠标右键,然后在Visual Studio中更新服务引用会引发错误:

下载“”时出错。请求失败,HTTP状态为400:请求错误。元数据包含无法解析的引用:(等…)

如果我打开
https://www.test.com/WCF/MyService.svc
https://www.test.com/WCF/MyService.svc?wsdl
在我的web浏览器中,我还收到了400个错误请求但是,如果我通过http(而不是https)访问这些URL中的任何一个,那么我将获得服务屏幕和wsdl。然后,我尝试在VS中请求服务更新时使用http,它可以工作,但该服务应该只使用HTTPS

这是我的服务器端
web.config

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" 
            multipleSiteBindingsEnabled="false" 
            minFreeMemoryPercentageToActivateService="0"/>
    <bindings>
        <wsHttpBinding>
            <binding name="wsHttpBindingConfig" 
                 receiveTimeout="00:05:00" sendTimeout="00:01:00" 
                 maxReceivedMessageSize="5000000">
                <security mode="TransportWithMessageCredential">
                    <transport clientCredentialType="None"/>
                    <message clientCredentialType="UserName"/>
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <services>
        <service name="MyService"
                 behaviorConfiguration="ServiceBehavior" >
            <endpoint name="MyServiceEndpoint" 
                address="https://www.test.com/WCF/MyService.svc" 
                binding="wsHttpBinding" 
                bindingConfiguration="wsHttpBindingConfig" 
                contract="IMyService"/>
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="ServiceBehavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>
                <serviceCredentials>
                    <userNameAuthentication 
                         userNamePasswordValidationMode="MembershipProvider" 
                         membershipProviderName="AspNetSqlMembershipProvider"/>
                </serviceCredentials>
                <serviceAuthorization 
                     principalPermissionMode="UseAspNetRoles" 
                     roleProviderName="AspNetSqlRoleProvider"/>
            </behavior>
            <behavior name="">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <!-- enables WCF logging -->
    <diagnostics wmiProviderEnabled="false" performanceCounters="Off">
        <messageLogging logEntireMessage="true" 
              logMalformedMessages="true" logMessagesAtServiceLevel="true" 
              logMessagesAtTransportLevel="true" maxMessagesToLog="200" 
              maxSizeOfMessageToLog="50000"/>
    </diagnostics>
</system.serviceModel>

一些可能有帮助的背景信息(?):

  • 刚刚在我的开发机器上升级到Win10和VS2015。尝试在VS2010或VS2015中更新服务引用会得到相同的结果

  • 刚刚意识到我的网络托管公司并没有像我付钱给他们那样将更新应用到服务器上。刚刚对我信任的旧Win2008服务器进行了4年(!)的Windows更新

  • Chrome抱怨我的服务器的证书有效但过时(使用SHA1),其他浏览器没有抱怨。我有一个SHA2证书在路上,但不知道这会有什么不同

  • 最后,web服务现在仍然通过HTTPS以其原有的容量工作。但任何通过HTTPS更新引用的尝试都会失败,请求错误为400


    两天的google/stackoverflow搜索,我什么都找不到。有人有什么提示、线索或东西要尝试吗?

    我不知道发生了什么,但我以前可以通过HTTPS更新引用,现在不行了。我想我之所以担心是因为我认为这会影响app.config中端点的“自动配置”。但是,通过HTTP更新服务引用似乎对我的app.config设置(通过HTTPS访问服务)没有影响


    换句话说,没有任何问题。我刚刚通过HTTP进行了更新,我的WinForms应用程序仍然可以通过HTTPS调用该服务。没问题。

    您已经定义了
    -->您可以通过HTTP://-而不是
    HTTPS
    获取服务元数据。尝试添加https支持:
    -这有什么帮助吗?@mark\s:使用httpGetEnabled=“true”和/或httpsGetEnabled=“true”在浏览器或VS中都没有任何区别。看起来应该如此~这意味着什么?我还可以提到,自上次运行良好以来,我对web.config进行了零更改。在我的VS客户端项目中,服务引用地址被设置为https(这是我以前更新它们的方式)。如果我删除
    httpGetEnabled=“true”
    ,则通过HTTP浏览服务时,它将给我一条“此服务的元数据发布当前已禁用”消息。但是,当通过HTTPS浏览时,添加
    httpsGetEnabled=“true”
    仍然会给我一个HTTP 400错误请求。