title: Error: Cannot obtain Metadata from http ......?wsdl
body: <p>I have been in the process of converting a http application to https and ssl with a self signed certificate.</p>
  
  <p>for some reason i have to go in the browser to localhost:##### to start the service.</p>
  
  <p>Once the service is started, i test it with the following call in the visual studio 2012 comman prompt:</p>
  
  <pre><code>svcutil.exe https://localhost:10201/?wsdl
  </code></pre>
  
  <p>and it comes back with</p>
  
  <pre><code>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 /?"
  </code></pre>
  
  <p>Is this detremental to my sucess with HTTPS?  </p>
  
  <p>My config looks as such:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  
      &lt;!--SERVICES--&gt;
      &lt;services&gt;
        &lt;service name="DuplexService.DuplexService"
           behaviorConfiguration="sb"&gt;
  
          &lt;endpoint
             address="basic"
             binding="customBinding"
             bindingConfiguration="customDuplexBinding"
             contract="DuplexService.Interface.IDuplexServiceContract"&gt;
          &lt;/endpoint&gt;
  
          &lt;endpoint
              address=""
              binding="webHttpBinding"
              behaviorConfiguration="webHttpEndpointBehavior"
              bindingConfiguration="webHttpsBinding"
              contract="Interface.IPolicyRetriever"&gt;
          &lt;/endpoint&gt;
  
          &lt;endpoint
              address="mex"
              binding="mexHttpsBinding"
              contract="IMetadataExchange"&gt;
          &lt;/endpoint&gt;
  
          &lt;host&gt;
          &lt;baseAddresses&gt;
            &lt;add baseAddress="https://localhost:10201" /&gt;
          &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
  
  
      &lt;/services&gt;
  
  
      &lt;!--BEHAVIOURS--&gt;
      &lt;behaviors&gt;
      &lt;!--Policy--&gt;
        &lt;endpointBehaviors&gt;
          &lt;!-- For Policy Service --&gt;
          &lt;behavior name="webHttpEndpointBehavior"&gt;
            &lt;webHttp  /&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
  
  
  &lt;!--behaviour for all of the enpoints --&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="sb"&gt;
            &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
            &lt;serviceMetadata httpsGetEnabled="true" httpsGetUrl="https://localhost:10201"/&gt;
            &lt;!-- 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 --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
            &lt;!-- This will solve a bug that happens if too many items are sent at once from the gateway to the client --&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt;
            &lt;serviceThrottling
            maxConcurrentCalls="200"
            maxConcurrentSessions="200"
            maxConcurrentInstances="200" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
  
  
  
      &lt;!-- BINDINGS--&gt;
      &lt;bindings&gt;
  
      &lt;webHttpBinding&gt;
          &lt;binding name="webHttpsBinding"&gt;
              &lt;security mode="Transport"&gt;
                  &lt;transport clientCredentialType="None" /&gt;
              &lt;/security&gt;
          &lt;/binding&gt;
      &lt;/webHttpBinding&gt;
  
        &lt;customBinding&gt;
          &lt;binding name="customDuplexBinding"&gt;
            &lt;pollingDuplex duplexMode="MultipleMessagesPerPoll"
                 maxOutputDelay="00:00:01"
         serverPollTimeout="00:01:00"
         inactivityTimeout="02:00:00"
         maxPendingMessagesPerSession="2147483647"
         maxPendingSessions="2147483647" /&gt;
            &lt;binaryMessageEncoding&gt;
              &lt;readerQuotas
                maxDepth="2147483647"
                maxStringContentLength="2147483647"
                maxArrayLength="2147483647"
                maxBytesPerRead="2147483647"
                maxNameTableCharCount="2147483647" /&gt;
            &lt;/binaryMessageEncoding&gt;
            &lt;httpsTransport
        maxBufferSize="2147483647"
        maxReceivedMessageSize="2147483647"
        transferMode="StreamedResponse" /&gt;
          &lt;/binding&gt;
        &lt;/customBinding&gt;
  
  
  
      &lt;/bindings&gt;
  
  
  
  
      &lt;!-- Register the binding extension from the SDK. --&gt;
      &lt;extensions&gt;
        &lt;bindingElementExtensions&gt;
          &lt;add name="pollingDuplex"
               type="System.ServiceModel.Configuration.PollingDuplexElement, System.ServiceModel.PollingDuplex" /&gt;
        &lt;/bindingElementExtensions&gt;
      &lt;/extensions&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>How can i get rid of it? and make the metadata work and the GET work?</p>