views:

22

answers:

1

Hi there, I dont know what I have done wrong but whenever my service model is returning less than 2 results I am getting an error.

I have asked on the silverlight forum with no joy.

System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query 'GetEmployees'. Unexpected end of file. Following elements are not closed: LastModifiedDate, Employee, RootResults, GetEmployeesResult, GetEmployeesResponse. ---> System.Xml.XmlException: Unexpected end of file. Following elements are not closed: LastModifiedDate, Employee, RootResults, GetEmployeesResult, GetEmployeesResponse. at System.ServiceModel.DomainServices.Client.WebDomainClient`1.EndQueryCore(IAsyncResult asyncResult) at System.ServiceModel.DomainServices.Client.DomainClient.EndQuery(IAsyncResult asyncResult) at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) --- End of inner exception stack trace ---

My domain service is basic and looks like this

[Query(IsDefault = true)] 
    public IQueryable<Employee> GetEmployees() 
    { 
        return this.ObjectContext.Employees.Where(e=>e.IsDeleted==false); 
    }

My xaml looks like this

  <riaControls:DomainDataSource  
        AutoLoad="True" 
        x:Name="dsEmployee"  
        LoadedData="dsEmployee_LoadedData" 
        SubmittedChanges="dsEmployee_SubmittedChanges" 
        QueryName="GetEmployees"> 
        <riaControls:DomainDataSource.DomainContext> 
            <my:MyDomainContext /> 
        </riaControls:DomainDataSource.DomainContext> 
    </riaControls:DomainDataSource>

         <ListBox  
                                x:Name="lstEmployees" 
                                ItemsSource="{Binding ElementName=dsEmployee, Path=Data}" 
                                Grid.Row="1"  
                                VerticalAlignment="Top" 

                                Height="360" MouseLeftButtonUp="lstEmployees_MouseLeftButtonUp"> 
                                        <ListBox.ItemTemplate> 
                                            <DataTemplate> 
                                                <StackPanel Orientation="Horizontal" 
                                                    x:Name="stackEmployees" 
                                                    MouseRightButtonDown="lstEmployees_MouseRightButtonDown"> 
                                                    <TextBlock Text="{Binding EmployeeName}"  
                                                               Style="{StaticResource RewardGridText}" 
                                                               Width="220"  
                                                               TextAlignment="Left"> 
                                                    <telerik:RadContextMenu.ContextMenu> 
                                                          <telerik:RadContextMenu x:Name="ContextMenu"  
                                                                                  ItemClick="ContextMenuClick" 
                                                                                  Opened="ContextMenuOpened"> 

                                                                <telerik:RadMenuItem Header="Edit" /> 
                                                              <telerik:RadMenuItem Header="Disable" /> 
                                                                <telerik:RadMenuItem Header="Delete" /> 
                                                          </telerik:RadContextMenu>    
                                                    </telerik:RadContextMenu.ContextMenu> 
                                                    </TextBlock> 
                                                    <TextBlock Text="{Binding Converter={StaticResource RoleConverter}}" Style="{StaticResource RewardGridText}"  Width="160" TextAlignment="Left"/> 
                                                    <TextBlock Text="{Binding Converter={StaticResource AccountStatusConverter}}" Style="{StaticResource RewardGridText}"  Width="160" TextAlignment="Center"/> 




                                                </StackPanel> 
                                            </DataTemplate> 
                                        </ListBox.ItemTemplate> 
                                    </ListBox>

My codebind is just handling the errors. Does anyone know what I have wired up wrong?