views:

4529

answers:

11

I have a very simple sample silverlight application. I added a domain service to it with an entity model that has one entity. The client app simply loads all rows in the entity at startup. When I run this on my development box, it works as expected. However, when I move it to our test server I get an exception saying that the method I am calling cannot be found (Load operation failed for query 'GetCTCStation'. The remote server returned an error. NotFound.). When I inspected the client/server communication more closely with Fiddler I found out that the request is going to http://%5Bserver url]/ClientBin/SilverlightApplication7-Client-Web-CTCService.svc/binary. I added the domain service to the root of the web project, so I don't understand why the client is looking for it in the ClientBin directory. It's obviously not there. What am I doing wrong here? I have never had any issues with July preview version of RIA.


It is relative, but that is handled in the Generated_Code file automatically. And there is nothing in the webconfig to configure. I used default settings when creating a domain service. I tried explicitly setting the uri when instantiating the service and same exception occurred.

A: 

Did you check the address portion of your binding configuration? It looks like it is using a relative address.

Sako73
A: 

If you inspect the error on that service request (which is normal the way you are seeing it), what does the contents in Fiddler say? NotFound is generit in the plugin, but fiddler is likely showing you an HTTP 500 or something with some more detail in the response body.

Tim Heuer
A: 

HTTP/1.1 500 System.ServiceModel.ServiceActivationException Date: Tue, 08 Dec 2009 21:06:19 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Length: 0

Dragan
A: 

I think you are onto something here. I looked at the event log and found the following: Event Type: Error Event Source: System.ServiceModel 3.0.0.0 Event Category: WebHost Event ID: 3 Date: 12/8/2009 Time: 4:06:19 PM User: NT AUTHORITY\NETWORK SERVICE Computer: USHAGN047 Description: WebHost failed to process a request. Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/24230272 Exception: System.ServiceModel.ServiceActivationException: The service '/Silverlight/Services/SilverlightApplication7-Client-Web-CTCService.svc' cannot be activated due to an exception during compilation. The exception message is: IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.. ---> System.InvalidOperationException: IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used. at System.ServiceModel.Web.WebServiceHost.SetBindingCredentialBasedOnHostedEnvironment(ServiceEndpoint serviceEndpoint, AuthenticationSchemes supportedSchemes) at System.ServiceModel.Web.WebServiceHost.AddAutomaticWebHttpBindingEndpoints(ServiceHost host, IDictionary`2 implementedContracts, String multipleContractsErrorMessage) at System.ServiceModel.Web.WebServiceHost.OnOpening() at System.Web.Ria.Services.ServiceUtility.WebServiceHostInspector.OnOpening() at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open() at System.Web.Ria.Services.ServiceUtility.WebServiceHostInspector.Inspect() at System.Web.Ria.Services.ServiceUtility.get_CredentialType() at System.Web.Ria.Services.DomainServiceHost.AddRestWithJsonEndpoint(Uri baseAddress) at System.Web.Ria.Services.DomainServiceHost.AddEndpoints() at System.Web.Ria.Services.DomainServiceHost.ApplyConfiguration() at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) at System.Web.Ria.Services.DomainServiceHost..ctor(Type domainServiceType, Uri[] baseAddresses) at System.Web.Ria.Services.DomainServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) --- End of inner exception stack trace --- at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) Process Name: w3wp Process ID: 3320

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

I remember seeing something about WCF activation else where. I did not look into it because I have another project on the same server that is using WCF Silverlight enabled service and it is working fine. I'll look into it this morning. Thank you for pointing in the right direction about Fiddler body message.

Dragan
+2  A: 

After a long struggle and trying out many different options I finally found the solution. This post was the key: http://forums.silverlight.net/forums/t/146639.aspx

Basically, some dll's were not inluded in the bin folder when publishing the project. Make sure under References that the following dll's are setup correctly (Make sure that System.ComponentModel.DataAnnotations is pointing to C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\System.ComponentModel.DataAnnotations.dll):

System.ComponentModel.DataAnnotations and every dll that starts with System.Web needs to have "Copy Local" set to true.

Build the project and publish again. This fixed the problem for me.

I would like to thank everyone that contributed to the solution of this issue (in this thread and others).

Dragan
A: 

1) What IIS are you deploing on? If < 7 You need Hotfix

2) Include all your RIA assemblies (Set Copy Local => True) Including:

System.Web.Ria

System.Web.DomainServices. (there 4 of them depending on what you are using)

3) This can be a result of your node in your ASPNET application being set to Windows, but your site being set to Anonymous in IIS. For most, simply changing node to mode=”Forms” will remove this error and allow you to continue. For others, if your IIS configuration is set to use both Integrated Auth as well as Anonymous, you’ll want to uncheck one of them in the Directory Security setting for the site in IIS management console.

Alexander
A: 

WCF RIA Services VS 2008 deployment errors

There are many nice postings on the net and the best one seems to be here (Thanks Tim) http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx

Although all the postings I found were useful in some way, the final solution in my case was the inappropriate DB connection string. Although the VS generated DB string worked fine within VS, I couldn’t deploy it to my QA server until I trimmed it to be like this:

add name="myEntities" connectionString="metadata=res://*/ReviewsModel.csdl|res://*/ReviewsModel.ssdl|res://*/ReviewsModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=dataSource;Initial Catalog=intitalCatalog;User ID=userID;Password=password;&quot;" providerName="System.Data.EntityClient" 
Jesse
A: 

WCF RIA Services VS 2008 deployment errors Here is the solution you are searching for download example and check your self live WCF RIA (Vs2008) service.

http://www.rajneeshnoonia.com/blog/2009/12/ria-wcf-configuration-finally-resolved/

Rajneesh Noonia
A: 

Dragan, I have two projects in my solution - Business Application and WCF RIA Services Class Library. In each project I have a reference System.ComponentModel.DataAnnotations. Which one should I change to "C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\System.ComponentModel.DataAnnotations.dll"?

Best regards, Kola.

Kola
A: 

Kola, you need to modify the WCF RIA Service Class Library project. The Business Application project has "Client" instead of "Client in it's path. Regards, Dragan

Dragan
A: 

In my case solution was to set "Copy Local" Property of following assemblies from WebSite's References Folder to "True":

System.ComponentModel.DataAnnotations System.ServiceModel.DomainServices.EntityFramework System.ServiceModel.DomainServices.Hosting System.ServiceModel.DomainServices.Hosting.OData System.ServiceModel.DomainServices.Server System.Web.ApplicationServices System.Web System.Web.Extensions System.Web.Mobile System.Web.Services

If all is correct after next rebuilding those assemblies will be copied to bin folder of your project. What's good any handy configuration of IIS 7 I didn't perform.

Sasha