2012-11-15 17 views
6

मैं एक http अनुप्रयोग को https और एसएसएल में स्वयं हस्ताक्षरित प्रमाणपत्र के साथ परिवर्तित करने की प्रक्रिया में रहा हूं।त्रुटि: http से मेटाडेटा प्राप्त नहीं कर सकता ......? Wsdl

किसी कारण से मुझे ब्राउजर में स्थानीयहोस्ट में जाना होगा: ##### सेवा शुरू करने के लिए।

एक बार सेवा शुरू होने पर मैं Visual Studio 2012 कमांडरों प्रॉम्प्ट में निम्नलिखित कॉल के साथ यह परीक्षण:

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 है एचटीटीपीएस के साथ?

मेरे config जैसे दिखता है:

<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> 

कैसे मैं इसे से छुटकारा पाने के कर सकते हैं? और मेटाडेटा काम करते हैं और काम करते हैं?

उत्तर

10

मैं इससे निपटने के 4 तरीकों के बारे में सोच सकता हूं।

  1. स्वयं हस्ताक्षरित प्रमाण को विश्वसनीय रूट ऑथ के रूप में स्थापित करें। एमएमसी -> सर्टिफिकेट
  2. wsdl पर नेविगेट करने के लिए ब्राउज़र का उपयोग करें (प्रमाण त्रुटि से पहले क्लिक करें), इसे सेव करें, और सीधे wsdl उत्पन्न करें।
    • आपके ब्राउज़र में wsdl का यूआरएल रखो और अतीत प्रमाणपत्र चेतावनी क्लिक करें ताकि आप वास्तविक wsdl
    • देख सकते हैं अपने कंप्यूटर को wsdl बचाओ। क्रोम में आप राइट क्लिक कर सकते हैं, के रूप में सहेजें।
    • दृश्य स्टूडियो में
      • सही परियोजना पर क्लिक करें और
      • "सेवा संदर्भ जोड़ें" पता बॉक्स में, भौतिक पथ दर्ज चयन करें (C: \ निर्देशिका ...) डाउनलोड किया wsdl की।
      • हिट से ऊपर जाएं
  3. आग Fiddler और https जो एक प्रमाणपत्र स्थापित करें और आप दूरस्थ प्रमाणपत्र त्रुटियों को अनदेखा करने का विकल्प दे देंगे डिक्रिप्ट करने के लिए यह बताना। यहां वर्णित है। http://proq.blogspot.com/2012/02/svcutil-and-https.html
  4. किसी विश्वसनीय रूट द्वारा हस्ताक्षरित प्रमाणपत्र का उपयोग करें।

मुझे प्रमाण त्रुटियों को अनदेखा करने के लिए एक svcutil विकल्प नहीं मिला।

+0

मदद नहीं की, लेकिन भविष्य में उत्तर के लिए अन्य पेपोल खोज के लिए उपयोगी होगा –

+1

विकल्प 3 ने एक इलाज किया! विकल्प 3 के लिए –

+0

ditto! – rhoeting

0

मुझे एक ही समस्या थी। मेरे लिए मैंने देखा कि https एक और प्रमाणपत्र का उपयोग कर रहा है जो समाप्ति तिथि के मामले में अमान्य था। यकीन नहीं है कि ऐसा क्यों हुआ। मैंने एचटीपीएस पोर्ट नंबर और एक नया स्वयं हस्ताक्षरित प्रमाणपत्र बदल दिया। WCFtestClinet HTTPS के माध्यम से सर्वर से कनेक्ट हो सकता है!

संबंधित मुद्दे