I've been looking around for a fix for this for some time now. I have been adding, which seems enlessly, to my web.config file all suggestions I've seen in order to fix this not working over SSL and working over basic http.
This is my current web.config:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>
<bindings>
<customBinding>
<binding name="basicConfig">
<binaryMessageEncoding/>
<httpTransport transferMode="Streamed" maxReceivedMessageSize="67108864" />
</binding>
</customBinding>
<webHttpBinding>
<binding name="Binding" crossDomainScriptAccessEnabled="true">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
<binding name="httpbind" crossDomainScriptAccessEnabled="true"/>
</webHttpBinding>
</bindings>
<client/>
<services>
<service name="Wcf.App.Service1" behaviorConfiguration="ServiceBehaviour">
<endpoint address="customBinding" binding="customBinding" bindingConfiguration="basicConfig" contract="Wcf.App.IService1"/>
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="REST" contract="Wcf.App.IService1"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior name="REST">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="REST">
<webHttp helpEnabled="true" defaultOutgoingResponseFormat="Json"/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
Most wsources say to do either 1 or the other (sometimes both) of the below:
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
and/or
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior name="REST">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
Which I currently have both in my web.config file.
As stated above, it works just fine when using HTTP:
I've also made sure that the IIS 8 that I am using to host the WCF RESTful web service was configured correctly. Again, I searched a lot and made sure that whatever was suggested I did. I currently have a legit PositiveSSL certificate from Comodo.
So any help with this issue to get resolved would be great!
UPDATE FIDDLE
# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
1 200 HTTP Tunnel to s--------a.info:443 0 chrome:1796
2 404 HTTPS s--------a.info /Service1.svc/GetData/5556932587 3,353 private text/html; charset=utf-8 chrome:1796
And this is what it looks like in fiddler for HTTP:
# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
1 200 HTTP s--------a.info /Service1.svc/GetData/5556932587 620 application/json; charset=utf-8 chrome:1796
However, just going to Service1.svc in HTTPS loads up just fine:
# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
1 200 HTTPS s--------a.info /Service1.svc 2,939 text/html; charset=UTF-8 chrome:1796
Update again Well it looks like I finally got the web.config file correct to enable the SSL version to work but now that breaks the original HTTP.....
<?xml version="1.0"?>
<configuration>
<appSettings/>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>
<bindings>
<customBinding>
<binding name="basicConfig">
<binaryMessageEncoding/>
<httpTransport transferMode="Streamed" maxReceivedMessageSize="67108864" />
</binding>
</customBinding>
<webHttpBinding>
<binding name="basicConfig">
<security mode="None">
<transport clientCredentialType="Basic"/>
</security>
</binding>
<binding>
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<client/>
<services>
<service name="Wcf.App.Service1" behaviorConfiguration="ServiceBehaviour">
<endpoint address="customBinding" binding="customBinding" bindingConfiguration="basicConfig" contract="Wcf.App.IService1"/>
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="REST" contract="Wcf.App.IService1"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior name="REST">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="ServiceBehaviour">
<webHttp helpEnabled="true" defaultOutgoingResponseFormat="Json"/>
</behavior>
<behavior name="REST">
<webHttp helpEnabled="true" defaultOutgoingResponseFormat="Json"/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
Anyone have suggestions on how to make both work at the same time?