Hosting WCF service with GoDaddy

by OfirYaron 6/9/2010 11:09:00 AM

Shared hosting it a big pain in my A**,
I've been trying (unsuccessfully) to upload an WCF service to my GoDaddy hosting account,

At first i've got good old:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

this error usally hide another a site exception that can be revealed by adding:
<httpErrors errorMode="Detailed"/> under
<system.webServer>
after dealing with that i've discovered the real error is due to duplicated web.config keys with GoDaddy's machine.config
the keys are

<modules>
      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>

That was solved by removing GoDaddy's key with pre-remove tags for each add tag like so:

<modules>
      <remove name="ScriptModule"/>
      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>

after that issue, I discovered that Godaddy doesn't recognize WCF service extension (.svc) and i'm getting the following error:

There is no build provider registered for the extension '.svc'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.

so to solve that i tried adding the extension my selfe by adding the following in the web.config under <system.web>:


<compilation>
      <buildProviders>
        <add extension=".svc" type="System.ServiceModel.Activation.ServiceBuildProvider,
         System.ServiceModel, Version=3.0.0.0, Culture=neutral,
         PublicKeyToken=b77a5c561934e089"/>
      </buildProviders>
</compilation>

only that took me back to 500 error,
I finally broke down and (no I did not cry) contact My beloved hosting company only to find out that they do not support WebServices.

If for any reason this post came up on your search and you're at step one...
walk it off - there isn't any known way of making WCF work on Godaddy Hosting account,
I've spent 4 hours learning it the hard way :(

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Linq with WCF

by OfirYaron 8/3/2009 7:51:00 AM

"An error occurred while receiving the HTTP response to
http://xxx/. This could be due to the service endpoint binding not using the HTTP protocol.
This could also be due to an HTTP request context being aborted by the server
(possibly due to the service shutting down). See server logs for more details."

Got this message while trying to communicate to a WCF service I’ve built,

My initial assumption was that I’m not using the suitable security binders at both sides (server and client) .

First thing I tried was striping down the authentication configuration to “none” – the same exception was still thrown.

Secondly I tried to remove the service functionality to most basic by returning null, It works, I’ve returned the functionality but kept returning null and guess what - still worked.

At this point it was clear that the is some problem with the object that I try to return, I assumed that my Linq to Sql objects were not Serialized, indeed that was the cause, if you’re having this exception and use Linq to Sql object as a returned object – Its probably it.

Here is a very helpful “how to” on the subject: http://www.west-wind.com/Weblog/posts/147218.aspx 

(All that need to be done is changing the DataContext Serialization Mode to Unidirectional)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

WCF

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent posts

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in