Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:12:43+00:00 2026-06-09T14:12:43+00:00

Hello and thanks in advance for you help. I am working with a silverlight

  • 0

Hello and thanks in advance for you help. I am working with a silverlight application using a WCF service. I have a service contract with three operation contracts: GetModuleObjects(), GetServerObjects(), and GetMonitorGroupObjects(), which retrieve modules, servers, and server groups respectively from a database. I have code which adds three events to the Service Client instance in Main. The first two events are firing correctly, but for some reason the code in the third event is never being reached, which is a problem. My code in Main.xaml.cs is as follows:

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 SilverlightTreeviewTest.ServiceReference1;
using System.Collections.ObjectModel;

namespace SilverlightTreeviewTest
{
    public partial class MainPage : UserControl
    {
        static public ObservableCollection<ModuleObject> TableModuleObjects = new ObservableCollection<ModuleObject>();
        static public ObservableCollection<ServerObject> TableServerObjects = new ObservableCollection<ServerObject>();
        static public ObservableCollection<ServerGroupOCollection> TableMonitorGroupObjects = new ObservableCollection<ServerGroupOCollection>();

        public MainPage()
        {

            InitializeComponent();
            Service1Client MyWebService = new Service1Client();


            MyWebService.GetModuleObjectsCompleted += new EventHandler<GetModuleObjectsCompletedEventArgs>(MyWebService_GetModuleObjectsCompleted);
            MyWebService.GetModuleObjectsAsync();
        }

        void MyWebService_GetModuleObjectsCompleted(object sender, GetModuleObjectsCompletedEventArgs e)
        {
            dataGrid1.ItemsSource = e.Result;
            foreach (DataTest_ModuleObject item in e.Result)
            {
                ModuleObject module = new ModuleObject((string)item.ModuleName,(int)item.ModuleStatus,(int)item.ServerID,(int)item.ID);
                TableModuleObjects.Add(module);
            }

            Service1Client WebServiceForServers = new Service1Client();
            WebServiceForServers.GetServerObjectsCompleted += new EventHandler<GetServerObjectsCompletedEventArgs>(WebServiceForServers_GetServerObjectsCompleted);
            WebServiceForServers.GetServerObjectsAsync();
        }

        void WebServiceForServers_GetServerObjectsCompleted(object sender, GetServerObjectsCompletedEventArgs e)
        {
            //get each server entry from table and create ServerObject for each
            //find the modules from the module collection then add server to server collection
            foreach (DataTest_ServerObject item in e.Result)
            {
                ServerObject server = new ServerObject((string)item.ServerName,(int)item.ID,(int)item.Group_Id);
                server.FindModules(TableModuleObjects);
                TableServerObjects.Add(server);

            }

            //fire event to retrieve Monitor groups from db and assign servers to them
            Service1Client WebServiceForGroups = new Service1Client();
            WebServiceForGroups.GetMonitorGroupObjectsCompleted += new EventHandler<GetMonitorGroupObjectsCompletedEventArgs>(WebServiceForGroups_GetMonitorGroupObjectsCompleted);
            WebServiceForGroups.GetServerObjectsAsync();
        }

        void WebServiceForGroups_GetMonitorGroupObjectsCompleted(object sender, GetMonitorGroupObjectsCompletedEventArgs e)
        {
            //get each MonitorGroup entry from table and create MonitorGroupObject(ServerGroupOCollection) for each
            //find associated servers and then add the group to the collection of groups
            foreach (DataTest_MonitorGroupObject item in e.Result)
            {
                ServerGroupOCollection mGroup = new ServerGroupOCollection((string)item.MonitorGroup_Name, (int)item.ID, (int)item.MonitorGroup_Type);
                mGroup.FindServers(TableServerObjects);
                TableMonitorGroupObjects.Add(mGroup);
            }
        }

    }
}

I don’t understand why the third event is never being fired and its code never reached. Please help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:12:45+00:00Added an answer on June 9, 2026 at 2:12 pm

    In WebServiceForServers_GetServerObjectsCompleted you are registering an EventHandler for GetMonitorGroupObjectsCompleted but then invoking the GetServerObjectsAsync method.

    Surely you mean to invoke GetMonitorGroupObjectsAsync (or similar).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello and thanks in advance for any help you can provide. My AIR application
Hello and thanks in advance for your help. I have a treeview that is
Hello all and thanks for any help in advance. I have a ruby on
Hello and thanks in advance for the help. I have a sql table hosted
Hello and thanks in advance for the communal help I always find here. I
Hello and thanks for your help in advance. I am starting on the NHibernate
Hello there and thanks in advance for any help on the following matter. Edit:
Hello and thanks in advance for the help! Here's the issue I've installed an
Hello (and thanks in advance) I'm in a bit of a quandry, I cant
Hello and thanks to everyone for reading my question. I've been working on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.