1

I have some self hosted services and need to use metadata on the client side. When I open the service using WcfTestClient, it gets failed with the mesage "Error: Cannot obtain Metadata from https://localhost:8000/" What should I fix ?

<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="PrinterServiceBehavior">
                <serviceMetadata httpGetEnabled="false" httpsGetEnabled="True"/>
                <serviceDebug includeExceptionDetailInFaults="False" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <bindings>
        <wsHttpBinding>
            <binding name="TransportSecurity">
                <security mode="Transport">
                    <transport clientCredentialType="Basic"/>
                </security>
            </binding>
            <binding name="NoSecurity">
                <security mode="None" />
            </binding>
        </wsHttpBinding>
    </bindings>
    <services>
        <service behaviorConfiguration="PrinterServiceBehavior" name="App.PrinterService">
            <host>
                <baseAddresses>
                    <add baseAddress="https://localhost:8000/" />
                </baseAddresses>
            </host>
            <endpoint address="printer" binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="App.IPrinterService" />
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        </service>
    </services>
</system.serviceModel>
  • Check the links in my response to the following post, might give you some things to try or rule out: http://stackoverflow.com/questions/14817195/wcf-test-client-and-authentication/14834041#14834041 – Tanner Feb 19 '13 at 16:37

1 Answers1

0

Have you configured your SSL certificate with HTTP.SYS to get SSL with self host working? Here is a good blog post that explains how to configure SSL with selfhost.

Praburaj
  • 11,417
  • 1
  • 23
  • 20