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 6056875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:25:34+00:00 2026-05-23T08:25:34+00:00

All, I was just implementing a Webservices method that needs to take as an

  • 0

All,

I was just implementing a Webservices method that needs to take as an argument a list of objects. On the client side, I tried to call this passing it a list of the objects, but the compiler complained saying that it needed an ObservableCollection instead. Here is the code:

Server Side

[WebMethod]
public void SaveMarks(List<CompletedMark> marks)
{
    // TODO: IMPLEMENT SAVING THE MARKS
}

Client Side

private void SaveMarks()
{
    ObservableCollection<CompletedMark> marks = new ObservableCollection<CompletedMark>();
    //List<CompletedMark> marks = new List<CompletedMark>();

    foreach (SelectedField elem in SelectedFields)
    {
        marks.Add(new CompletedMark
                      {
                          FormId = curFormId,
                          QuestionId = elem.Qid,
                          XPos = Canvas.GetLeft(elem.assocGrid),
                          YPos = Canvas.GetTop(elem.assocGrid),
                          Width = elem.assocGrid.Width,
                          Height = elem.assocGrid.Height
                      });
    }
    proxy.SaveMarksAsync(marks);
}

I have commented out the line where I originally specified the List. Why is it that I need to use an ObservableCollection here even though I declared it as type List on the server? Is my server-side declaration incorrect?

  • 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-05-23T08:25:34+00:00Added an answer on May 23, 2026 at 8:25 am

    The default type collections are serialized to in Silverlight is ObservableCollection, mainly for ease in using it for DataBinding purposes. Ehsan’s answer is correct; you can change what the default type is in the Configure Service Reference dialog.

    Alternatively, you can change this to serialize to a generic list (probably more useful if you have a variety of consumers, or if this is more of a data-transfer-object instead of something you’d bind directly to).

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

Sidebar

Related Questions

I have an sql statement that currently is just returning all the end parent
The preamble We're implementing a MVC2 site that needs to consume an external API
I'm implementing a REST web service that will be used from all around the
I have just been implementing a google map, that pulls data from the yelp
I'm working on implementing a dynamic linked list in C just to brush up
Without thinking about it at all I just want to say I should allow
Now I'm trying to work with System.Web.Routing. All is just fine, but I can't
Hi all I've just started a new project using Visual Web Developer 2008 Express
I know I could just make all the Mix_Musics public, and not worry about
Up until now I just put all my jQuery goodness inside the $(document).ready() function,

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.