Dave Burke : Freelance .NET Web Developer specializing in Online Communities

WCF .SVC 404.3 W2K8 IIS7 Fix

That's a fun title, eh?  Let's see if the keywords improve on it.

Keywords: Service SVC is undefined, SVC 404 Not Found, AJAX WCF JQuery, SVC file 404.3, SVC in browser, Windows Server 2008 and WCF, IIS7

No, guess not.

I finally began my trip down JQuery Road, thinking it will be a useful tool in conjunction with WCF for some cool Sueetie v.Next functionality.  I spent hours trying to connect JQuery with a WCF .SVC service on my Sueetie development site, so hopefully sharing my solution will help someone else.

The problem was compounded by the fact that while investigating Rick Strahl's excellent JQuery sample solution using the Visual Studio Web Server, JQuery and WCFs worked perfectly.  So I became sidetracked thinking it was an IIS7 binding issue to http://sueetie on my standalone Windows 2008 Server. 

I banged my head against a "'SueetieService' is Underfined" error for the longest time.



Then, thanks to Fiddler 2, I discovered that I was getting a 404 when trying to browse the .SVC file, as in http://sueetie/SueetieService.SVC.  Again, I could browse .SVCs in Rick Strahl's project using the Visual Studio Web Server just fine. 

It turned out that my solution was adding WCF Activation in Windows Server 2008's Features for .NET Framework 3.0 as shown below.


 

Afterward, browsing to http://sueetie/SueetieService.svc worked successfully.


 

For completeness sake, here is my working <system.serviceModel /> web.config area.

 

<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="SueetieServiceAspNetAjaxBehavior" >
                <serviceDebug includeExceptionDetailInFaults="true" />
                <serviceMetadata httpGetEnabled="true" />
            </behavior>
        </serviceBehaviors>
        <endpointBehaviors>
            <behavior name="SueetieServiceAspNetAjaxBehavior">
                <enableWebScript />
            </behavior>
        </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
        <service name="SueetieService"
            behaviorConfiguration="SueetieServiceAspNetAjaxBehavior">
            <host>
                <baseAddresses>
                    <add baseAddress="
http://sueetie/SueetieService.svc"/>
                </baseAddresses>
            </host>
            <endpoint address="
http://sueetie/SueetieService.svc"
                behaviorConfiguration="SueetieServiceAspNetAjaxBehavior"
                binding="webHttpBinding"
                contract="SueetieService" />
        </service>
    </services>
</system.serviceModel>

 

There!  Hopefully that will save someone else a few hours a head-banging finding their way into the light with JQuery and WCF.

Comments (0) | Post RSS RSS comment feed

Posted on 4/8/2009 1:21:38 PM by Dave Burke
Categories: .NET | JQuery
Tags: No tags for this post

Related posts

Comments are closed

This site was built with the Sueetie .NET Open Source Community Framework. Learn more about Sueetie at Sueetie.com.