none
Could not find a base address that matches scheme https for the endpoint with binding MetadataExchangeHttpsBinding. Registered base address schemes are [http]. RRS feed

  • Question

  • Hi guys,

          I have created application under Web with WCF Service Library project. The web.config file below. I am getting error as mentioned in header.

    Could you please help me out.

    <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <!-- configure wsHttp binding with Transport security mode
                       and clientCredentialType as None -->
            <binding name="CalcSSLBinding">
              <security mode="Transport">
                <transport clientCredentialType="None"/>
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
    		<services>
    			<service behaviorConfiguration="CalcSSL.CalcSSLServiceBehavior" name="CalcSSL.CalcSSLService">
            <host>
              <baseAddresses>
                <add baseAddress = "https://localhost:443/CalcSSL/" />
              </baseAddresses>
            </host>
    				<endpoint address="https://localhost/CalcSSL/CalcSSLService.svc" binding="wsHttpBinding" contract="CalcSSL.ICalcSSLService" bindingConfiguration="CalcSSLBinding">
    					<identity>
    						<dns value="localhost"/>
    					</identity>
    				</endpoint>
    				<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
    			</service>
    		</services>
    		<behaviors>
    			<serviceBehaviors>
    				<behavior name="CalcSSL.CalcSSLServiceBehavior">
    					<!-- 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/CalcSSL/CalcSSLService.svc"/>
    					<!-- 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="false"/>
    				</behavior>
    			</serviceBehaviors>
    		</behaviors>
    	</system.serviceModel>


    Regards, CPK_2011

    Tuesday, May 15, 2012 2:22 PM

Answers

  • There certainly is an alternative. You can remove your mex endpoint and just use the following as you have already done in the above example:

    <serviceMetadata httpsGetEnabled="true" httpsGetUrl="https://localhost/CalcSSL/CalcSSLService.svc"/>

    The, when locating the metadata use the following url:

    https://localhost/CalcSSL/CalcSSLService.svc?wsdl

    This is what your service should look like for SSL using IIS:

          <system.serviceModel>
            <bindings>
              <wsHttpBinding>
                <binding name="CalcSSLBinding">
                  <security mode="Transport">
                    <transport clientCredentialType="None"/>
                  </security>
                </binding>
              </wsHttpBinding>
            </bindings>
            <services>
              <service behaviorConfiguration="CalcSSL.CalcSSLServiceBehavior" name="CalcSSL.CalcSSLService">
                <endpoint address="" binding="wsHttpBinding" contract="CalcSSL.ICalcSSLService" bindingConfiguration="CalcSSLBinding"/>                        
              </service>
            </services>
            <behaviors>
              <serviceBehaviors>
                <behavior name="CalcSSL.CalcSSLServiceBehavior">
                  <serviceMetadata httpsGetEnabled="true" httpsGetUrl="https://localhost/CalcSSL/CalcSSLService.svc"/>
                  <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
              </serviceBehaviors>
            </behaviors>
          </system.serviceModel>

    Another thing you should be aware of is the CalcSSLService.svc file:

    <%@ ServiceHost Language="C#" Debug="true" Service="CalcSSL.CalcSSLService" CodeBehind="~/App_Code/CalcSSLService.cs" %>
    You may need to change the CodeBehind attribute to the location of your code file
    Friday, May 18, 2012 2:20 AM