I am trying to host a WCF webservice at appharbor.com The service is responding as expected when hosted locally, but when build and hosted at appharbor, it only returns 404.
The service is running in a console application:
namespace Service.Host
{
class Program
{
static void Main(string[] args)
{
var host = new ServiceHost<AchievementService>();
host.Open();
Console.WriteLine("AchievementService is running...\nPush any key to terminate.");
Console.ReadLine();
host.Close();
}
}
}
The app.config is looking like this:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="Service.Main.AchievementService">
<host>
<baseAddresses>
<add baseAddress="http://achiever.apphb.com"/>
<!--<add baseAddress="http://localhost"/>-->
</baseAddresses>
</host>
<endpoint address="AchievementService/"
behaviorConfiguration="RestBehavior"
binding="webHttpBinding"
contract="Service.Main.Contracts.IAchievementService"/>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="RestBehavior">
<webHttp helpEnabled="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>
If i use the baseaddress containing the value "http://localhost" i can access the get method, metadata, help etc in my webservice. But when i change it to achiever.apphb.com and builds it, i only receive 404 at http://achiever.apphb.com/AchievementService/ or http://achiever.apphb.com/
What I have tried is various configurations of addresses, i've tried localhost builded at appharbor with same result. I have also searched for examples, but i havn't found anything that could help me out with this problem.
The service is deployed and is not containing any tests, with the note from appharbor:
5/5/12 6:02 PM: Received notification, queuing build
5/5/12 6:02 PM: Downloading source
5/5/12 6:02 PM: Downloaded source in 0.27 seconds
5/5/12 6:02 PM: Starting build
5/5/12 6:02 PM: 0 warnings
5/5/12 6:02 PM: Build completed in 1.57 seconds Details
5/5/12 6:02 PM: Starting website precompilation
5/5/12 6:02 PM: Precompilation completed
5/5/12 6:02 PM: Starting tests
5/5/12 6:02 PM: Tests completed in 2.39 seconds
5/5/12 6:02 PM: Build successfully deployed
Tests
Build contains no tests