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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:08:39+00:00 2026-05-23T05:08:39+00:00

what is the easiest way to send complex graphs of arbitrary data types from

  • 0

what is the easiest way to send complex graphs of arbitrary data types from a WCF service to a silverlight client for instance? Here the DataContractSerializer is mentioned as the default serialization engine for WCF. It also says that “All publicly visible types that have a constructor that does not have parameters” can be serialized. This sounds to me like it would be possible to send arbitrary types over a WCF service. Is this true? No need for DataContracts, XmlElement attributes and things like that? Supposed it is true, which limitations on the client side exist (only clients which use (a subset) of the .NET framework for instance)?

Additionally it would be really nice if you could tell me, what the best stream would be to use in conjunction with DataContractSerializer.WriteObject(Stream stream, Object graph) for a Silverlight client.

  • 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-23T05:08:40+00:00Added an answer on May 23, 2026 at 5:08 am

    Yes, it’s true, you don’t need to decorate the class with [DataContract], [Serializable], [Xml…] to have WCF serialize it. You can send arbitrary types as long as they follow a certain pattern (parameterless constructor, only serializing public fields / properties). There’s a good article about POCO (plain old CLR objects) serialziation in WCF at http://www.pluralsight-training.net/community/blogs/aaron/archive/2008/05/13/50934.aspx.

    As far as limitations on other clients, such as Silverlight, if the types are supported in the client, then it should work as well.

    And for your last question, it doesn’t really matter (as long as you can write to the stream). If you want to serialize an object to a file (in the Silverlight isolated storage), you’ll likely end up using a FileStream; if you want to serialize an object over the network directly, you may use the stream returned by HttpWebRequest.EndGetRequestStream; if you want to do some in-memory manipulation, you may use a MemoryStream. But it really doesn’t matter for the serializer. For the DCS, it’s just a Stream.

    One more thing, if you have a WCF service and are consuming it using Silverlight (for example, by using the Add Service Reference – ASR – to create a proxy to it), you don’t need to worry about serialization – the proxy generated by the ASR wizard will use the internal WCF classes to handle the serialization for you, all you need to do is to call the methods in the proxy passing the objects directly.

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

Sidebar

Related Questions

What is the best and easiest way to send a string from one instance
What is the easiest and most efficient way to insert data from a DataTable
What would be the easiest way to be able to send and receive raw
What would be the easiest way to separate the directory name from the file
What's the easiest way to convert a percentage to a color ranging from Green
What is the easiest way to merge XML from two distinct DOM Documents? Is
What is the easiest way to send and receive mails in java.
The easiest way to think of my question is to think of a single,
The easiest way to explain this problem is to show you some code: Public
In TFS whats the easiest way of linking a backlog item to a large

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.