I have a WCF service hosted in a webrole in Azure.
When I test it in dev fabric it works ok from my web page (other web role).
But when I deploy it in the Cloud it doesn’t seems to be running, although the webrole is ready.
When I use Fiddler to do a GET on one of the public methods of my WCF service, I get:
[Fiddler] Connection to
xxxxxxxxxxxxxx.cloudapp.net failed.
Exception Text: A connection attempt
failed because the connected party did
not properly respond after a period of
time, or established connection failed
because connected host has failed to
respond yyyyyyyyyyyyyy
This is the service configuration:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="GovGuard" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="GovGuard.Services">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="GuardServiceEndpointBinding" endpointName="GuardServiceEndpoint" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="DevelopmentConnectionString" />
<Setting name="GovGuardStorageConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="GuardServiceEndpoint" protocol="http" port="81" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="MyCompany.GovGuard.Services.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
</LocalResources>
</WebRole>
<WebRole name="GovGuard.Web">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="GuardWebEndpointBinding" endpointName="GuardWebEndpoint" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="GuardServiceUrl" />
<Setting name="DevelopmentConnectionString" />
<Setting name="GovGuardStorageConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="GuardWebEndpoint" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="MyCompany.GovGuard.Web.svclog" cleanOnRoleRecycle="false" sizeInMB="1000" />
</LocalResources>
</WebRole>
</ServiceDefinition>
(edit)
In my investigation of the problem it may be this: I use the Microsoft.SqlServer.Types assembly as file reference in the WCF project. I use copy-local = true to copy the assembly to the bin folder and it is packaged in the .csx file. But…. the Microsoft.SqlServer.Types also needs the SqlServerSpatial.dll library (not assembly). I created a postbuild script to copy that dll to the bin also, but I didn’t succeed….
Maybe someone can help me how to package a dll (not an assembly) to the .csx file….
(edit)
Found it here: http://msdn.microsoft.com/en-us/gg271395
Finally the solution that works: I develop on a 32 bit Win7 machine and I copied the SqlServerSpatial.dll from my machine to the WCF project (with Copy to Output Directory and BuildAction Content). That caused a weird error message in the Cloud, because that library was 32 bit! I renewed the library with a 64 bit version and now after deploy in the Cloud everything works!