Problem with Silverlight applications using WCF (WCF RIA)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 13 años
NC1.9 needs up to implement Silverlight module to the Silverlight works at 100%. The problem occurs when using WCF (WCF RIA). When a query to a database via a Web service from the database are not shown any data (the database contains data). When using Silverlight applications outside of the NC1.9 data after a query from the database appear in the order.

It is necessary to add any Web service special authorization? Alternatively, where the problem could be?

Getting data in Silverlight using the following code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Data.Services.Client;
using NopCommerceStore.SL.NopSolutionsServiceReference;

namespace NopCommerceStore.SL
{
    public partial class MainPage : UserControl
    {
        private NopSolutionsServiceReference.DataManager dataManager = new NopSolutionsServiceReference.DataManager(new Uri("NopSolutionsServiceReference.svc", UriKind.Relative));

        public MainPage()
        {
            InitializeComponent();
            DataServiceQuery<Nop_Banner> query = dataManager.Nop_Banners;
            query.BeginExecute(b => { DataServiceQuery<Nop_Banner> state = b.AsyncState as DataServiceQuery<Nop_Banner>;
            ObservableCollection<Nop_Banner> data = new ObservableCollection<Nop_Banner>();
            foreach (var entity in state.EndExecute(b)) data.Add(entity);
            this.bannerGrid.ItemsSource = data;
            },query);
        }
    }
}


In NC1.9 I created a new domain model using Telerik OpenAccess ORM, I use it very often and I have yet to encountered no problem.

WCF contains the following code:

namespace NopSolutions.NopCommerce.Web
{
  using System.Data.Services;

    /// <summary>
    /// SampleServiceName Service Class Handler
    /// </summary>
    [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public partial class SampleServiceName : DataService<DataManager>
    {
    /// <summary>
        /// Initializes the service.
        /// </summary>
        /// <param name="config">The config.</param>
        public static void InitializeService(IDataServiceConfiguration config)
        {
                config.SetEntitySetAccessRule("Nop_Banners", EntitySetRights.All);
        }
        
        /// <summary>
        /// Called when an exception is thrown while processing a request.
        /// </summary>
        /// <param name="args">Exception arguments.</param>
        protected override void HandleException(HandleExceptionArgs args)
        {
            base.HandleException(args);
        }
    }
}


I beg you for any comments and suggestions to ensure proper functioning.
Hace 12 años
Hi,

Did you find a solution to this problem? I'm having the exact same issue and I've been pulling my hair out trying to identify the cause?

Thanks,

Ben
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.