Okay, I must be missing something utterly simple here, because I\'ve been googling for days, and looking at dozens of answers there, and here on SO, and i just CANNOT get th
I had the same issue and spent one day to resolve this issue. Finally below configuration worked me for HTTPS access.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding">
</binding>
<binding name="basicHttpsBinding">
<security mode="Transport">
<transport clientCredentialType ="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="standingsBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://www.mydomain.com/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<services>
<service behaviorConfiguration="standingsBehavior" name="lijslwebdata">
<endpoint address="" binding="basicHttpBinding" contract="lijslwebdata"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
<service behaviorConfiguration="standingsBehavior" name="sslwebdata">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpsBinding" contract="sslwebdata"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
I was dealing with this recently, and want to add a tweak. If you follow the above instructions, you'll be able to get the service to work with HTTPS, but not simultaneously work on both HTTP and HTTPS. To do that, you need to have two endpoint configuration nodes, one for each protocol as follows:
<service name="MyCompany.MyService" >
<endpoint address="" behaviorConfiguration="AspNetAjaxBehavior"
binding="webHttpBinding" contract="MyCompany.MyService" bindingConfiguration="sslBinding" />
<endpoint address="" behaviorConfiguration="AspNetAjaxBehavior"
binding="webHttpBinding" contract="MyCompany.MyService" />
</service>
(taken from my codebase, adjust behaviorConfiguration and binding as appropriate)
Several of the answers led me into reconfigure my web.config to contain two endpoints. I ended up with this following Web.config.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding">
</binding>
<binding name="basicHttpsBinding">
<security mode="Transport">
<transport clientCredentialType ="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="standingsBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://www.myhost.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<services>
<service behaviorConfiguration="standingsBehavior" name="NameSpace.ClassName">
<endpoint address="" binding="basicHttpBinding" contract="NameSpace.ContractInterfaceName"/>
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpsBinding" contract="NameSpace.ContractInterfaceName"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
Just another thing to check if you're encountering the same 404 error as OP. I fiddled with lots of things, but finally the solution came down to merely adding the namespace to my service web.config.
So plain old ServiceFoo and IServiceFoo did NOT work:
<services>
<service behaviorConfiguration="quuxBehavior" name="ServiceFoo">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpsBinding" contract="IServiceFoo"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
But adding the namespace (ProjectBar) DID work:
<services>
<service behaviorConfiguration="quuxBehavior" name="ProjectBar.ServiceFoo">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpsBinding" contract="ProjectBar.IServiceFoo"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>