views:

2478

answers:

4

It seems the world is awash with people having problems deploying RIA WCF services, and now I'm one too. I've already tried a bunch of things, but to no avail. I need WCF RIA to support a Silverlight 3 application I've built.

The short story is, using the new WCF RIA services (Nov 09?) I open VS 2008, create new project (silverlight application), enabling ".NET RIA services". Add new item to web project - Linq2SQL dbml file (from SQL 2005 DB prepared earlier) and compile. I add a new item to the web project - domain service (link the tables I need) and compiled. Using the domain context I "Load" data with a standard RIA get query in the MainPage and add a TextBlock to display returned data. Build & run (cassini) - success. Using VS to publish to IIS on local PC - success.

Using VS to publish to test server (IIS6) - browse to location and the Silverlight app loads but Fiddler tells me I've got a 404 on all the the WCF .svc requests. Use Fiddler to "launch IE" on the service request and it's true - 404.

I have already run aspnet_regiis, ServiceModelReg and added mime types for .xap, .xaml, .xbap and .svc. I have included the System.Web.Ria and System.Web.DomainServices DLL with copy local true.

I need help with either

a) a solution

b) an approach to find a solution

+2  A: 

Hey,

I had some troubles with this also, although once I figured them out it's relatively straight forward.

First, run through http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx (although it seems you have most of that covered off).

Check that you have your DomainServiceModule in the web.config in the new system.webServer bit and the old bit for IIS6:

    <httpModules>
   <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
   <add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </httpModules>

Finally, I had to create my services manually, by creating .svc files where SL is looking for them (from fiddler) and filling them in with:

<%@ ServiceHost Service="NameOfSerice" Factory="System.Web.Ria.DomainServiceHostFactoryEx" %>

Make sure that you also visit the .svc file directly (without the /binary on the end) as you can get some nice errors there (well once you solve your 404 of course!)

HTH,

Jordan.

Jordan
Thanks for the suggestion. I have been through Heuer's suggestions, althought I never understood how to make an actual .SVC file, so thanks for that. Fiddler tells me it's looking for /PatientBoard/ClientBin/PatientJourneyWeb-PJService.svc/binary - so I should make a file called PatientJourneyWeb-PJService.svc and put text you outlined in there? do I substitute "PatientJourneyWeb-PJService" in Service="NameOfSerice"?
Handleman
First, try going to /PatientBoard/ClientBin/PatientJourneyWeb-PJService.svc and see what you get... It may be trying to redirect you to a login page? If so, then ensure IIS is set to anon + forms auth, and not windows auth... If that doenst help, then create the service in that spot called exactly that (without binary) and point the service host to your domain service.
Jordan
Thanks for your help. I got a 404 when opening the service directly, adding the svc file now I get 500 : "The type 'PatientJourneyWeb.PJService', provided as the Service attribute value in the ServiceHost directive could not be found. "
Handleman
Is all good now ... It turns out I wasn't copying all the required DLLs locally. I found this by enabling the Fusion logging (described here - http://www.thejoyofcode.com/WCF_The_type_provided_as_the_Service_attribute_could_not_be_found.aspx). In my case I needed to "copy local" 4 DLLs :System.ComponentModel.DataAnnotationsSystem.Web.DomainServicesSystem.Web.DomainServices.LinqToSqlSystem.Web.Ria(the first not being detailed in Tim Heuer's blog)
Handleman
A: 

Hi.

I think you would only use FactoryEx if you extended the Factory as described here. Also, according to my help files, the full name is System.Web.Ria.Services.DomainServiceHostFactory, but the parser can't create that type either, although I have System.Web.Ria in the GAC.

I agree - deploying WCF RIA over https is a challenge - I have yet to get it to work.

pjholmes
A: 

I ran into the same problem. Worked fine with the cassini server under Windows 7. Deployed to Windows Server 2008 R2 with IIS7, and it would not work. Fiddler reported that an 'EndPointNotFoundException' was being thrown.

My solution, since I have full control of the server, was to install Visual Studio 2008 Express, Silverlight 3 SDK, and the WCF RIA Services Beta for VS2008. This meant that the necessary DLLs were already installed in the GAC. I don't think this affected the result, but I turned off 'Copy Local' for the RIA DLLs that were referenced by the Web app.

Probably an unorthodox solution, but it worked for me!!! Actually, I did this at the suggestion of Microsoft Support.

By the way, support for this through Microsoft is very sparse at this time. They are actually trying to figure out right now internally who is going to support this technology: WCF team or Silverlight team. I know it's still in beta, but be warned that a 'GoLive' license doesn't mean its fully supported. I had someone from the WCF team who went out of his way to help me on this, but gave me a disclaimer several times during the call, that it wasn't really supported through those channels yet.

Rick Arthur
A: 

I fought this issue for a little while myself where it could not find the .svc file. I soon realized it wasn't just my .svc, it was all .svc files. It then appeared to be an IIS6 issue. It turns out that the ASP.NET v4.0x Web Service Extensions are set to "Prohibited" by default. Went into Web Service Extensions config and set ASP.NET v4.0x to "Allowed" and life was all good.

Brian