2012-11-15 18 views
6

httpアプリケーションをhttpsとsslに変換し、自己署名入りの証明書で処理しています。エラー:httpからメタデータを取得できません......?wsdl

何らかの理由で、私はサービスを開始するためにブラウザにlocalhost:#####を入れなければなりません。

サービスが開始されると、私は、Visual Studio 2012 commanプロンプトで次の呼び出しでそれをテストします。

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

、それは

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ですHTTPSで?

私の設定は、次のようななります

私はそれを取り除くことができますどのように
<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> 

?メタデータの作業とGETの作業を行いますか?

答えて

10

私はこれに対処する4つの方法を考えることができます。

  1. 信頼できるルート認証として自己署名証明書をインストールします。 MMC - >証明書
  2. ブラウザを使用してwsdlに移動し(証明書エラーをクリックして)、オフにしてwsdlを直接生成します。
    • がお使いのブラウザで、WSDLのURLを入れて、あなたのコンピュータにWSDLを保存し、実際のWSDL
    • を見ることができるように、証明書の警告を過ぎてクリックしてください。クロムで右クリックし、別名で保存できます。 Visual Studioで
      • プロジェクトを右クリックして、物理パスを入力し、[アドレス]ボックスに
      • 「サービス参照の追加」を選択:ダウンロードしたWSDLの(C \ディレクトリを...)。
      • ヒットはシオマネキを
  3. 火を移動して、証明書をインストールして、あなたのリモート証明書エラーを無視するオプションを提供します、HTTPSの暗号化を解除するためにそれを伝えます。ここで説明します。 http://proq.blogspot.com/2012/02/svcutil-and-https.html
  4. 信頼できるルートで署名された証明書を使用します。

証明書のエラーを無視するためのsvcutilオプションはありませんでした。

+0

助けてくれませんでしたが、今後の回答を探すために役立つでしょう –

+1

オプション3がおすすめです!オプション3の同義語 –

+0

! – rhoeting

0

私は同じ問題がありました。私にとっては、httpsが有効期限の点で無効だった別の証明書を使用していることに気付きました。なぜそれが起こったのか分かりません。私は、Httpsポート番号と新しい自己署名証明書を変更しました。 WCFtestClinetはHTTPS経由でサーバーに接続できます。

関連する問題