IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Silverlight Discussion :

Exception: le serveur distant a retourné une erreur not found


Sujet :

Silverlight

  1. #1
    Membre à l'essai
    Inscrit en
    Mars 2012
    Messages
    21
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 21
    Points : 10
    Points
    10
    Par défaut Exception: le serveur distant a retourné une erreur not found
    Bonjour
    J'ai besoin d'afficher la liste des etudiants dans une datagrid a l'aide de WCF Services

    Voici le code de service :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    using System;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.Activation;
    using DAL;
    using POCO;
    using System.Collections.Generic;
    namespace ESPRIT_FLEET_MANAGER.Web
    {
        [ServiceContract(Namespace = "")]
        [SilverlightFaultBehavior]
        [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
        public class Service1
        {
     
            [OperationContract]
            public IList<Employees> LoadAll()
            {
                using (Esprit_FleetEntities db = new Esprit_FleetEntities())
                {
                    var records = from record in db.Employees select record;
                    return records.ToList();
                }
            }
     
     
            // Add more operations here and mark them with [OperationContract]
        }
    }
    voici le code de ma page main
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    sing 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.Windows.Navigation;
     
    namespace ESPRIT_FLEET_MANAGER
    {
        public partial class Page2 : Page
        {
            public Page2()
            {
                InitializeComponent();
                load();
            }
     
            // Executes when the user navigates to this page.
     
            public void load()
            {
                ServiceReference1.Service1Client serv = new ServiceReference1.Service1Client();
                serv.GetEmployeeByIdCompleted+=new EventHandler<ServiceReference1.GetEmployeeByIdCompletedEventArgs>(serv_GetEmployeeByIdCompleted);
                serv.GetEmployeeByIdAsync(2);
            }
            public void serv_GetEmployeeByIdCompleted(object sender, ServiceReference1.GetEmployeeByIdCompletedEventArgs e)
            {
                IEnumerable<ServiceReference1.Employees> list = e.Result as IEnumerable<ServiceReference1.Employees>;
     
               dataGrid1.ItemsSource = list;
            }
     
        }
    }
    Merci de m'aider

  2. #2
    Membre à l'essai
    Inscrit en
    Mars 2012
    Messages
    21
    Détails du profil
    Informations forums :
    Inscription : Mars 2012
    Messages : 21
    Points : 10
    Points
    10
    Par défaut
    le probleme c est quand je genère automatiquement les poco une exception
    "serveur retourne not found" pourtant avant de generer les poco l application marche !!!

  3. #3
    Invité
    Invité(e)
    Par défaut
    Salut,

    Server not found
    peut-être dû à plusieurs choses mais cependant tu peux regarder ça :
    1. Vérfier bien que l'url du service WCF est correct
    2. Désactiver le Lazy loading de tes objets POCO

Discussions similaires

  1. Le serveur distant a retourné une erreur: NotFound
    Par FirePrawn dans le forum Windows Communication Foundation
    Réponses: 2
    Dernier message: 18/01/2016, 01h39
  2. Le serveur distant a retourné une erreur : NotFound
    Par Louis745 dans le forum Silverlight
    Réponses: 3
    Dernier message: 08/10/2010, 00h38
  3. WFC Le serveur distant a retourné une erreur : NotFound
    Par hirochirak dans le forum Windows Communication Foundation
    Réponses: 2
    Dernier message: 26/08/2009, 10h58
  4. Réponses: 8
    Dernier message: 05/02/2008, 11h35
  5. [MSSQL 2005] Retourner une erreure dans une SP
    Par Danny Blue dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 01/08/2006, 08h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo