fretje
fretje

Reputation: 8382

Why are my entities disapearing after deploy?

I created an OData service for a couple of our entities, and on my developer machine (WinXP), everything works like it should, this is what I get when accessing the service:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://localhost:2332/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
  <workspace>
    <atom:title>Default</atom:title>
    <collection href="Client">
      <atom:title>Client</atom:title>
    </collection>
    <collection href="Vehicle">
      <atom:title>Vehicle</atom:title>
    </collection>
    <collection href="Contact">
      <atom:title>Contact</atom:title>
    </collection>
  </workspace>
</service>

Now after I deployed that service to a testserver (Win2K3), all my entities are gone:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://dev-cont2011b/ContactOData/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
  <workspace>
    <atom:title>Default</atom:title>
  </workspace>
</service>

There are no error messages, nothing in the event log. My connections string is ok (I tested this with a simple test.aspx page which fetches something out of the database and shows it on the page ==> this works).

When I manually enter the url for one of the entities (Client), this is what I get:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> 
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> 
  <code></code>
  <message xml:lang="nl-BE">Resource not found for the segment 'Client'.</message> 
</error>

The .NET Framework 3.5 is installed on that server. I ran all the updates.

I've been banging my head on this one for the last couple of hours. I don't know what else I can do or test.

Any suggestions?

Upvotes: 2

Views: 224

Answers (2)

fretje
fretje

Reputation: 8382

The solution was to install this update:

ADO.NET Data Services Update for .NET Framework 3.5 SP1 for Windows Server 2003, Windows XP, Windows Vista and Windows Server 2008

Apparently, this one isn't included into windows update by default. You have to run it manually.

This was needed because I changed the default InitializeService method so it takes a DataServiceConfiguration in stead of an IDataServiceConfiguration:

public static void InitializeService(DataServiceConfiguration config)
{
    config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
    config.DataServiceBehavior.MaxProtocolVersion = System.Data.Services.Common.DataServiceProtocolVersion.V2;
    config.SetEntitySetPageSize("*", 20);
}

This is needed if you want to enable server side paging (SetEntitySetPageSize) (amongst others).

Upvotes: 1

Shiraz Bhaiji
Shiraz Bhaiji

Reputation: 65461

New try:

It is a RESX problem

<message xml:lang="nl-BE">Resource not found for the segment 'Client'.</message> 

It is trying to lookup the nl-BE translation for the name Client.

Upvotes: 0

Related Questions