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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:33:43+00:00 2026-05-26T08:33:43+00:00

I thought I had read somewhere that Silverlight 4 was going to contain a

  • 0

I thought I had read somewhere that Silverlight 4 was going to contain a BinaryFormatter to support serializing/deserializing binary data in the client application but I can’t seem to locate it, so I’m guessing it’s not there.

I have an existing service I need to access from my Silverlight 4 application. The service uses sockets over TCP. I’ve been able to get the client app connected and am able to receive messages from the service but I cannot deserialize the content of the message.

The message consists of the following object serialized on the server:

class Message
{
    String Name { get; set; }
    Stream Data { get; set; }
}

I do not have control over the service and changing the format, protocol, etc. is not an option. (Also, fwiw, Name is variable length.)

How can I reconstitute the Message object in my 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-26T08:33:43+00:00Added an answer on May 26, 2026 at 8:33 am

    So, after much trial and error, I ended finding the following solution to my problem.

    First, I was able to get access to the server code which allowed me to change the Message class so instead of the Data property returning a Stream, it returns a Byte array. I then use the XmlSerializer to serialize the object to the outgoing NetworkStream. Apparently the XmlSerializer will use Base64 encoding by default and convert the byte array to a string which can be included in the XML stream.

    In the Silverlight client, I use the XmlSerializer to deserialize the byte array into the client-side object.

    Not exactly the same as binary serialization, but the ultimate goal was to deserialize the binary data (byte array) received from the Socket on the SL client and this gets me there.

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

Sidebar

Related Questions

I thought I read somewhere that ordering your using statements and getting rid of
I had a wild thought today. I've been discovering that my users like my
I read that invoking flush method guarantees that the last of the data you
Just when I thought I had this one cinched, I realized that I can
I had thought I could enumerate the types using IMetaDataImport.EnumTypeDefs and for each of
I thought I had seen a bug report about this on the jQuery site,
I thought I had a pretty good handle on memory management for objective-c, but
I thought I had this figured out but it turns out I'm just deleting
This may seem like a programming 101 question and I had thought I knew
Alright, I thought I had this whole setTimeout thing perfect but I seem to

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.