Deploy a WCF Web API, is it possible?

mastoj's Avatar

mastoj

30 May, 2011 09:37 PM

I just started trying out the possibilites with appharbor and got everything working just fine for my sample MVC app. However, when deploying my simple WCF Web Api app I get 404 error when I try to access my resource. Everything works just fine when it is deployed on my local IIS.

Is it anything I need to do to get it working? The WCF Web Api project is created from an empty Web project so I can't see why I just can't deploy it.

  1. Support Staff 2 Posted by friism on 30 May, 2011 11:13 PM

    friism's Avatar

    AppHarbor can host WCF services. Could you provide example urls that fail? Also, please invite support(a)appharbor.com as a collaborator so that we can take a look.

  2. 3 Posted by mastoj on 31 May, 2011 05:37 AM

    mastoj's Avatar

    I've invited support as a collaborator.

    It's not a standard WCF service, it is the new version as in this blog: http://geekswithblogs.net/michelotti/archive/2011/04/21/wcf-web-api.... But that shouldn't be any problem since it is still running .NET4 and all the dll's are copy local.

    Is there an easy way for me to debug what is going on? Can I see any of the logs?

  3. Support Staff 4 Posted by friism on 31 May, 2011 09:19 AM

    friism's Avatar

    We generally log exceptions and make them available in under "Errors" in the application interface. 404-errors are not logged here however.

    I'm attaching a screenshot of the error. There seems to be a problem with the route registration, since the handler is StaticFile. I've tried replacing your App_Start code with a more traditional Global.asax, to no avail.

    It might make sense to post this question on StackOverflow, since hosting WCF Web Api services is of general interest, and just to get some more eyes on it.

  4. 5 Posted by mastoj on 31 May, 2011 10:18 AM

    mastoj's Avatar

    Posted it on Stackoverflow: http://stackoverflow.com/questions/6186090/hosting-a-wcf-web-api-ap...

    If you have any more information please provide it there.

  5. 6 Posted by mastoj on 31 May, 2011 10:40 AM

    mastoj's Avatar

    I'm wondering if this is configured: http://geekswithblogs.net/michelotti/archive/2011/05/28/resolve-404...

    Maybe you haven't ExtensionlessUrlHandler-Integrated-4.0 setup at all? Just a thought. I have mine to handle GET,HEAD,POST,DEBUG,PUT,DELETE locally.

  6. 7 Posted by mastoj on 31 May, 2011 10:43 AM

    mastoj's Avatar

    I really think that might be the issue. I updated my local IIS and set the ExtensionlessUrlHandler-Integrated-4.0 to handle *.adad and since that doesn't map to the route I try to access the static file handler was used instead and I got the same error as you.

  7. Support Staff 8 Posted by friism on 31 May, 2011 03:57 PM

    friism's Avatar

    The handler is enabled (altough not for PUT and DELETE -- we'll look into that). So that does not explain why GET requests for /contacts/1 returns a 404...

  8. 9 Posted by mastoj on 31 May, 2011 05:07 PM

    mastoj's Avatar

    You are true, it is really strange. The app itself should be self contained as long as the ExtensionlessUrlHandler-Integrated-4.0 handle is configured. No answers on SO yet. Is it possible to see what has actually been deployed? Or maybe get a copy of that and try to deploy the code locally? Have you tried to deploy a wcf web api app your self?

  9. Support Staff 10 Posted by rune on 01 Jun, 2011 03:27 AM

    rune's Avatar

    Hi Tomas,

    I've answered this on Stack Overflow too, but you basically just need to add

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
    </system.webServer>
    

    We may be able to resolve this on our end too (seems there's a hotfix for it) http://support.microsoft.com/kb/980368 . We'll look into that and get back to you if it's no longer necessary to specify the runAllManagedModulesForAllRequests directive.

    Best,
    Rune

  10. rune closed this discussion on 01 Jun, 2011 03:27 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac