I am currently making a WCF service and while I was developing the service acted like it should (Using Visual Studio Web Expres). I have a silverlight application who is consuming the service.
I wrote the WCF service in a class Library and is implemented by a ASP.NET Web Application. While I was using the Visual Studio ASP.NET Development Server the service was happy and gave me everything I asked for.
Now I implemented the service on an IIS 7 Server. And the service doesnt return what I ask for anymore. Instead in Chrome I get the following message:

But If I surf to the service url then the service say’s it is ready to rock and roll:

As you can see in the Error I get from Chrome is that the text the service returns is the Source code from that “surf to” page.
My Web.config service model:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_OnlineCreatorServiceContract" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="OnlineCreatorServiceBehavior"
name="OnlineCreator.ServiceLibrary.OrderDataService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_OnlineCreatorServiceContract"
name="basicHttpBinding" contract="OnlineCreator.ServiceLibrary.IOrderDataService" />
<endpoint address="mex" binding="mexHttpBinding" name="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="OnlineCreator.Web.OnlineCreatorServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="OnlineCreatorServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
And my ServiceReferences.ClientConfig:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://subdomain.domain.com/mapWithServiceInIt/OnlineCreatorService.svc"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding"
contract="OnlineCreatorService.IOrderDataService" name="basicHttpBinding" />
</client>
</system.serviceModel>
</configuration>
Because my service is on a subdomain I have used to following ClientAccessPolicy.xml:
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
As you can see this can’t be the problem, but for completeness sake I have putted it here.
This is my first WCF service and it worked perfectly till I putted it on the IIS server. Does anyone has a clue why I get this error and how to fix it?
After I have dug deeper in WCF and IIS I found out that you need to activate WCF on the server. And that is quite the process. To do it right I cleared my current site on IIS to have a fresh start and then followed to following pages to get the WCF to work:
http://blah.winsmarts.com/2008-4-Host_a_WCF_Service_in_IIS_7_-and-amp;_Windows_2008_-_The_right_way.aspx
http://msdn.microsoft.com/en-us/library/ms751527.aspx
http://blogs.msdn.com/b/blambert/archive/2009/02/13/enable-iis.aspx
http://edinkapic.blogspot.com/2009/02/talking-to-wcf-service-from-silverlight.html
I made a very simpel HelloWorld service to test everything and as soon as it all worked I ported it to my service. That first gave me an exception. But that was soon fixed because the connection strings weren’t set right.