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

  • Home
  • SEARCH
  • 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 5935999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:20:09+00:00 2026-05-22T15:20:09+00:00

In full .NET it is pretty easy to swap out the serializer – either

  • 0

In “full” .NET it is pretty easy to swap out the serializer – either in configuration, or via custom attributes. However, I want to do something similar in Silverlight’s WCF – i.e. provide a different serialization engine. I will provide the engine (protobuf-net) – I just need to get WCF to use it!

Last time I looked at this (some time ago) no good options were obvious. My best kludge was to expose the data as byte[] or Stream – but this loses all the “mex” goodness. Which is a shame, as it all pretty-much just works in full .NET.

Is this yet possible? Bonus points for WP7 too 🙂

  • 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-22T15:20:10+00:00Added an answer on May 22, 2026 at 3:20 pm

    It is possible, but it’s quite hard to do. The class DataContractSerializerOperationBehavior (where you’d usually replace the serializer by overriding the CreateSerializer method) is internal in SL, so you can’t really use it. What you’d need to do is to create an IOperationBehavior which did what the DCSOB does – namely, set the IClientMessageFormatter which the client will use to convert between the Message body (XML Infoset) and the operation parameters / return values. That would mean writing the code to wrap / unwrap the parameters from the operation into / from the Message object. Not completely impossible, but it should work.

    As far as WP7, it doesn’t have the extensibility points required for this solution (IOperationBehavior, IClientMessageFormatter) aren’t there (they were added on SL4, and WP7 is roughly compatible with SL3), so I don’t think it’s possible there – or at least not in a generic way (you can have all your operations declared with Message objects – Message MyOperation(Message input) – and at that stage you can deal with the message Infoset (GetReaderAtBodyContents) directly, but that would need to be done in every operation call.

    Updated: well, I tried and it is possible to do it in Windows Phone 7 (and Silverlight 3) as well, it’s just a lot harder. I recreated the extensibility points using a pair of custom channels. The description of how this can be done can be found at http://blogs.msdn.com/b/carlosfigueira/archive/2011/06/21/wcf-extensibility-extensibility-in-windows-phone-and-silverlight-3.aspx.

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

Sidebar

Related Questions

i am pretty new to mootools, i found it faster/smoother for animations than jquery
I have asp.net application and a TabContainer from AjaxControlToolkit on a form. There are
I have an existing website developped using ASP.NET MVC 3 and Entity Framework 4
What is the fastest and more reliable way of generating thumbnails in .NET? I
I'm using a WebBrowser control in .NET CF 3.5 for a Windows CE device
I am in a process of planning an architecture for a line of business
It's not clicking how one is supposed to connect to a hosted Cloudant database
I'm working on a C# application that allows users to basically import tables of
I've inherited a web app in need of some maintenance and all of the
I have a form partial that looks like this: <%= form_for(@pool) do |f| %>

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.