【问题标题】:VS2013 generates wsdl as https with failing certificate for http wcf service and then fails to generate the client with svcutil.exeVS2013 将 wsdl 生成为 https 并且 http wcf 服务的证书失败,然后无法使用 svcutil.exe 生成客户端
【发布时间】:2014-12-02 14:24:39
【问题描述】:

我遇到了一个特殊的问题,然后 wcf 服务在 VS2013 上以调试模式在 http 上运行生成链接,并通过 https 运行在不同端口上的 wsdl。

如果我尝试转到http://localhost:53769/WebPricingService.svc?wsdl,它会运行几分钟并最终失败。

我对此并不关心,但是当我尝试使用 svcutil.exe 生成客户端并带有以下消息时它失败了

我已将mex 添加到配置中

<service behaviorConfiguration="wsServiceBehavior" name="Corp.WebServices.WebPricingService">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsEndpointBinding" name="ConveyancingEndpoint" contract="Corp.Core.Interfaces.IWebPricingService"/>
  <endpoint address="mex"
              binding="mexHttpBinding"
              contract="IMetadataExchange" />
  </service>

绑定

 <binding name="wsEndpointBinding" maxBufferPoolSize="2147483647"
      maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="Transport">
        <transport clientCredentialType="Windows" />
      </security>
    </binding>

为什么 wsdl 在不同的端口和协议上运行? 是否有简单的解决方法来生成客户端?

【问题讨论】:

    标签: wcf visual-studio-2013 wsdl .net-4.5 webservice-client


    【解决方案1】:

    自己解决了。

    我问为什么它运行不同端口的部分很简单 - 我很愚蠢。 http 和 https 不能同时在同一个端口上运行。

    要生成客户端,请转到http://localhost:53769/WebPricingService.svc?singleWsdl,然后在浏览器中File -&gt; Save As... 并将其保存在C:/ 中为someName.wsdl,然后打开VS 工具并运行svcutil.exe c:\someName.wsdl,这应该会在某些情况下为您提供名为someName.cs 的客户端我的目录是C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-03
      • 1970-01-01
      • 2013-01-02
      • 2012-01-28
      • 1970-01-01
      • 2016-11-15
      • 2018-04-09
      • 2015-09-09
      相关资源
      最近更新 更多