错误:无法从HTTP ...... WSDL获取元数据 [英] Error: Cannot obtain Metadata from http ......?wsdl

查看:1370
本文介绍了错误:无法从HTTP ...... WSDL获取元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在一个HTTP应用程序转换为HTTPS和SSL使用自签名证书的过程。

I have been in the process of converting a http application to https and ssl with a self signed certificate.

由于某种原因,我在浏览器中去本地主机:#####启动服务

for some reason i have to go in the browser to localhost:##### to start the service.

一旦该服务已启动,我在Visual Studio 2012 comman提示以下调用测试:

Once the service is started, i test it with the following call in the visual studio 2012 comman prompt:

svcutil.exe https://localhost:10201/?wsdl

和它

and it comes back with

Error: Cannot obtain Metadata from https://localhost:10201/?wsdl

If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.


WS-Metadata Exchange Error
    URI: https://localhost:10201/?wsdl

    Metadata contains a reference that cannot be resolved: 'https://localhost:10201/?wsdl'.

    Could not establish trust relationship for the SSL/TLS secure channel with authority 'localhost:10201'.

    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    The remote certificate is invalid according to the validation procedure.


HTTP GET Error
    URI: https://localhost:10201/?wsdl

    There was an error downloading 'https://localhost:10201/?wsdl'.

    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    The remote certificate is invalid according to the validation procedure.

If you would like more help, type "svcutil /?"



这是detremental我sucess使用HTTPS?

Is this detremental to my sucess with HTTPS?

我的配置看起来这样的:

My config looks as such:

<system.serviceModel>

    <!--SERVICES-->
    <services>
      <service name="DuplexService.DuplexService"
         behaviorConfiguration="sb">

        <endpoint
           address="basic"
           binding="customBinding"
           bindingConfiguration="customDuplexBinding"
           contract="DuplexService.Interface.IDuplexServiceContract">
        </endpoint>

        <endpoint
            address=""
            binding="webHttpBinding"
            behaviorConfiguration="webHttpEndpointBehavior"
            bindingConfiguration="webHttpsBinding"
            contract="Interface.IPolicyRetriever">
        </endpoint>

        <endpoint
            address="mex"
            binding="mexHttpsBinding"
            contract="IMetadataExchange">
        </endpoint>

        <host>
        <baseAddresses>
          <add baseAddress="https://localhost:10201" />
        </baseAddresses>
        </host>
      </service>


    </services>


    <!--BEHAVIOURS-->
    <behaviors>
    <!--Policy-->
      <endpointBehaviors>
        <!-- For Policy Service -->
        <behavior name="webHttpEndpointBehavior">
          <webHttp  />
        </behavior>
      </endpointBehaviors>


<!--behaviour for all of the enpoints -->
      <serviceBehaviors>
        <behavior name="sb">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpsGetEnabled="true" httpsGetUrl="https://localhost:10201"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <!-- This will solve a bug that happens if too many items are sent at once from the gateway to the client -->
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          <serviceThrottling
          maxConcurrentCalls="200"
          maxConcurrentSessions="200"
          maxConcurrentInstances="200" />
        </behavior>
      </serviceBehaviors>
    </behaviors>



    <!-- BINDINGS-->
    <bindings>

    <webHttpBinding>
        <binding name="webHttpsBinding">
            <security mode="Transport">
                <transport clientCredentialType="None" />
            </security>
        </binding>
    </webHttpBinding>

      <customBinding>
        <binding name="customDuplexBinding">
          <pollingDuplex duplexMode="MultipleMessagesPerPoll"
               maxOutputDelay="00:00:01"
       serverPollTimeout="00:01:00"
       inactivityTimeout="02:00:00"
       maxPendingMessagesPerSession="2147483647"
       maxPendingSessions="2147483647" />
          <binaryMessageEncoding>
            <readerQuotas
              maxDepth="2147483647"
              maxStringContentLength="2147483647"
              maxArrayLength="2147483647"
              maxBytesPerRead="2147483647"
              maxNameTableCharCount="2147483647" />
          </binaryMessageEncoding>
          <httpsTransport
      maxBufferSize="2147483647"
      maxReceivedMessageSize="2147483647"
      transferMode="StreamedResponse" />
        </binding>
      </customBinding>



    </bindings>




    <!-- Register the binding extension from the SDK. -->
    <extensions>
      <bindingElementExtensions>
        <add name="pollingDuplex"
             type="System.ServiceModel.Configuration.PollingDuplexElement, System.ServiceModel.PollingDuplex" />
      </bindingElementExtensions>
    </extensions>
  </system.serviceModel>



我怎样才能摆脱它?并进行元数据工作和找份工作?

How can i get rid of it? and make the metadata work and the GET work?

推荐答案

我能想到的4种方式来处理这个问题。

I can think of 4 ways to deal with this.


  1. 安装的自签名证书作为信任根权威性。 MMC - >证书

  2. 使用浏览器浏览到WSDL(点击过去证书错误),保存它,并直接生成过的WSDL。

    • 把你的浏览器中的WSDL的网址,然后点击过去证书警告,这样就可以看到实际的WSDL

    • 保存WSDL到您的计算机。在Chrome中,您可以点击右键,另存为。

    • 在Visual Studio中

      • 右键单击该项目并选择添加服务引用

      • 在地址框中,输入的物理路径(C:\directory ...)。下载的WSDL的

      • 击去

  1. Install the self signed cert as a trusted root auth. MMC -> Certificates
  2. Use a browser to navigate to the wsdl (click past the cert error), save it off, and generate off the wsdl directly.
    • Put the url of the wsdl in your browser and click past the certificate warning so that you can see the actual wsdl
    • Save the wsdl to your computer. In chrome you can right click, save as.
    • In Visual Studio
      • Right click on the project and select "Add Service Reference"
      • In the Address box, enter the physical path (C:\directory...) of the downloaded wsdl.
      • Hit Go

我没有看到一个SvcUtil工具选择忽略证书错误。

I didn't see a svcutil option to ignore cert errors.

这篇关于错误:无法从HTTP ...... WSDL获取元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆