This is a migrated thread and some comments may be shown as answers.

Cannot Add Service Reference - Silverlight

8 Answers 132 Views
Web Services
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jim
Top achievements
Rank 1
Jim asked on 19 Jun 2010, 11:32 PM
After I used the DSW to reverse map my DB, I tried to add a service reference to my Silverlight project and got this message:

The server encountered an error processing the request.

The exception message is 'On data context type 'DataManager', there is a top
IQueryable property 'ControlTypeNs' whose element type is not an entity type.

Make sure that the IQueryable property is of entity type or specify
the IgnoreProperties attribute on the data context type to ignore this
property.'.

See server logs for more details. The exception stack trace is:  at
System.Data.Services.Providers.ReflectionServiceProvider.PopulateMetadata...


It looks to me like the element type (ControlTypeN) is an entity type, so I tried specifying IgnoreProperties.  Then I got this message:

The server encountered an error processing the request.

The exception message is 'ETag attribute must specify at least one property name.
Parameter name: propertyNames'.

See server logs for more details. The exception stack trace is: at
System.Data.Services.IgnorePropertiesAttribute..ctor...


Can you help?

I did find one place in the generated code (for the class derived from OpenAccessContext) that contained Controltypens instead of ControlTypeNs.  I thought there might be a case problem in the generated code, but changing it did not help.

8 Answers, 1 is accepted

Sort by
0
Jim
Top achievements
Rank 1
answered on 20 Jun 2010, 12:20 AM
I have opened ticket 320489 and attached the project.
0
Missing User
answered on 21 Jun 2010, 07:46 PM
Hi James,

I would like just to inform you that I have received your attached file and I will write to you as soon as I find the problem.

I suggest that we continue the discussion regarding this problem here so we do not have to write in two different threads.

Kind regards,
Rizk Sobhi
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Missing User
answered on 25 Jun 2010, 06:21 PM
Hello James,

Let me apologize for the late reply, I had a look into the project that you had attached in your previous letter and I noticed that you have selected to generate Views along with the database tables as part of your RLINQ model. However OpenAccess requires identity selection for all of the classes that are mapped to views, so the user has to select primary key properties for each of them manually. Otherwise, this leads to the generation of a DalDataServiceKeys class containing the properties of the classes mapped to views but without their primary keys specified.

I would suggest you to delete any view properties existing at this class and ignore them in the DataManager class as well. This is only a temporary workaround as we have already provided a fix for this behavior and it will be available as part of the Q2 release, three weeks from now.

I tried this solution in a simple project using the Northwind database and I have attached it so you can use it as a reference towards your fix.
Please have a look at this project, especially at the DataManager and DalDataServiceKey classes.
Hope that helps

Sincerely yours,
Rizk Sobhi
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jim
Top achievements
Rank 1
answered on 28 Jun 2010, 03:28 AM
I installed the latest version of ORM and then created a new solution from scratch, not including any views when I added the domain model.  I get the same message, although in a popup this time.  I am not able to identify any differences between your project and mine.  I have looked at ControlTypeN in the rlinq file, and all the properties look correct to me.

Again, I will post the solution in the ticket.

BTW, is there some way to find stuff in the graphical representation of the rlinq file?  It seems pretty much useless, so I use the xml version.
0
Jordan
Telerik team
answered on 16 Jul 2010, 01:44 PM
Hello James,

About finding things in the DSL designer, actually there already is such functionality.
Both the model explorer and the schema explorer have a search bar on top that allows for easy searching in both the relational model and in the object model.
I hope this helps.

Sincerely yours,
Jordan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jim
Top achievements
Rank 1
answered on 16 Jul 2010, 07:09 PM
Perfect. Thank you.
0
mickael
Top achievements
Rank 1
answered on 29 Jul 2010, 04:12 PM
Hello, i reopen the subject because i have a probleme with the DalDataServiceKey.cs .
Indeed i follow the quickstart tutorial (Getting Started > Quickstart > Quickstart - Silverlight 4 > Using WCF Data Services > Walkthrough: Creating a WCF Data Services Solution ), i follow each step, then in the data service wizard, on the last step with the summary i got this :

 3. Add the files listed below to ORM_SL.Web.
    1. SampleServiceName.svc
    2. SampleServiceName.svc.cs
    3. DataManager.cs

 4. Add the references listed below to ORM_SL.Web.
    1. System.Data.Entity.dll
    2. System.Data.Services.dll
    3. System.Data.Services.Client.dll
    4. System.ServiceModel.dll
    5. System.ServiceModel.Web.dll
 
 5. Add the files listed below to ORM_SL.Web.
    1. DalDataServiceKeys.cs

 6. Add the references listed below to ORM_SL.Web.
   1. System.Data.Services.Client.dll

But the problème is that the DalDataServiceKeys.cs is not created, i must do it manualy .
I have just downloaded the sowftare so i think i get the last version.
What i done bad?
Thanks you !

ps:Sorry for my bad english!

0
Missing User
answered on 30 Jul 2010, 07:40 PM
Hi mickael,

Actually we have discovered this problem with the wizard when creating a web application or web site which contains the .rlinq model as well as the generated service. So a simple workaround is to separate the model away from the service, so you can create a class library which contains the model, and another web application or web site to hold the service.
We already have the fix which will be included at the upcoming version, so you should not experience this problem again.
Sorry for inconvenience
.
Regards,
Rizk Sobhi
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Web Services
Asked by
Jim
Top achievements
Rank 1
Answers by
Jim
Top achievements
Rank 1
Missing User
Jordan
Telerik team
mickael
Top achievements
Rank 1
Share this question
or