Hi,
This is giving me a headache:
I have a web service with a service contact in my web application. All I need to do is consume it as an SSL web service and not allow access via unsecured http.
I think my issue is the web.config and app.config for my unit test project.
Here is my current incarnation of Web.config:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpsBinding" maxReceivedMessageSize="524288000">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="Certificate" algorithmSuite="Default"/>
</security>
</binding>
<binding name="mexHttpBinding" maxReceivedMessageSize="524288000" />
</basicHttpBinding>
</bindings>
<services>
<service name="fw.Services.AServiceAccess">
<endpoint address="" binding="basicHttpBinding" contract="fw.Services.IAServiceAccess" bindingConfiguration="basicHttpsBinding">
</endpoint>
</service>
</services>
</system.serviceModel>
and here is my app.config
<configuration>
<system.net>
<settings>
<servicePointManager checkCertificateName="false" checkCertificateRevocationList="false"/>
</settings>
</system.net>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAServiceAccess" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://www.fw.codep.co.uk/Services/AServiceAccess.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAServiceAccess"
contract="ASecureAccessService.IAServiceAccess"
name="BasicHttpBinding_IAServiceAccess" />
</client>
</system.serviceModel>
</configuration>
I did get the service working with standard http with large requests. If I use https in the addess I get the error:
Debug Trace:
TestCorrectDetails: AssemblyInit {0}
AssemblyCleanup
Test method FlightWatchUnitTests.Application.WebInterface.Services.AirlineServiceAccessTest.TestCorrectDetails threw exception:
System.ServiceModel.Security.MessageSecurityException: The HTTP request was forbidden with client authentication scheme 'Anonymous'. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
The default subdomain is dev. but I have www. (and others) set as valid subdomains.
I have googled long and hard but almost all instances of WCF web services are not set up the way I have done it, and config settings make my head hurt >_<
Can anyone help me get back on track with this?
Thanks ^_^
Andy
EDIT: Updated configs and error message to latest issue