Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding

Tags:

c#

.net

xml

https

wcf

I dida wcf username/password authentication on my local computer, with self signed certificate, all works fine, but when i put my application on IIS 7.5, and windows server 2008 R2, it gaves me the error:

Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https]. My web service cfg:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceCredentialsBehavior">
      <serviceCredentials>
        <serviceCertificate findValue="cn=AmicCert" storeName="Root" storeLocation="LocalMachine" />
        <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Util.CustomUserNameValidator, Util" />
      </serviceCredentials>
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service behaviorConfiguration="ServiceCredentialsBehavior" name="Service">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="MessageAndUserName" name="SecuredByTransportEndpoint" contract="IService" />
  </service>
</services>
<bindings>
  <wsHttpBinding>
    <binding name="MessageAndUserName">
      <security mode="Message">
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
      <client />
   </system.serviceModel>
  <system.web>
<compilation debug="true" />
 </system.web>
 </configuration>
like image 888
croisharp Avatar asked Jul 27 '11 14:07

croisharp


2 Answers

It sounds like the IIS web site instance you're hosting under is only configured for HTTPS (SSL). Right click the web site instance and choose "Edit Bindings...". Do you see port 80 (plain HTTP) listed there? Also check the "SSL Settings" feature to make sure the "Always require" option is not turned on.

like image 117
Drew Marsh Avatar answered Sep 19 '22 21:09

Drew Marsh


Drew's answer is correct if you don't want to use HTTPS/SSL for the endpoint.

If you do want to use SSL over the endpoint, you need to change your:

<security mode="Message">

to:

<security mode="TransportWithMessageCredential">
like image 34
Darbio Avatar answered Sep 19 '22 21:09

Darbio