12-17-2009 1:13 AM |
Hi,
I createad a Silverlight 4 Beta 1 application with Visual Web Developer 2010 Beta 2, using Silverlight Business Application template.
I added an Entity Data Model pointing to AdventureWorks sample database, choosing only Contact table, and then I added a domain service class mapped to Contact entity of AdventureWorks data model (I also selected Enable Editing and Generate associated classes for metadata options).
Now in the Silverlight client application I added a datagrid named ContactGrid and then I loaded data in this way:
ContactContext context = new ContactContext();
ContactGrid.DataContext = context.Contacts;
context.Load(context.GetContactsQuery());
I get this error:
Load operation failed for query 'GetContacts'. Remote server error: NotFound.
Error details:
on System.Windows.Ria.OperationBase.Complete(Exception error)
on System.Windows.Ria.LoadOperation.Complete(Exception error)
on System.Windows.Ria.DomainContext.CompleteLoad(IAsyncResult asyncResult)
on System.Windows.Ria.DomainContext.<>c__DisplayClass17.<Load>b__13(Object )
I noticed that AuthenticationService (created by the project template) is working, and I can create new users and log in.
I'm developing the application on Windows XP SP3.
How can I solve this problem?
结局方案链接: http://forums.silverlight.net/forums/p/151112/338168.aspx
I found the problem: in the method GetContacts of ContactService domain service, I was returing all contacts, that are 19972 in AdventureWorks sample database.
If I take only the first 10, everything works fine:
public IQueryable<Contact> GetContacts()
{
return this.ObjectContext.Contacts.Take(10);
}
So I think there's a maximum response length. Where can I configure this maximum length?