Browse by Tags

Tagged Content List
  • Blog Post: Warning: DataContractSerializer won’t call your constructor!

    Consider the following naïve data contract: [DataContract] public class Data { private int [] array; public Data() { this .array = new int [13]; } public int Length { get { return this .array.Length; } } } It looks ok, right? Let’s use it then: DataContractSerializer serializer = new...
  • Blog Post: Adding HTTP Headers to WCF Calls

    To add HTTP headers, request messages have to be intercepted before they are sent to the server. This can be done by implementing the IClientMessageInspector.BeforeSendRequest method: /// <summary> /// Represents a message inspector object that can be added to the <c>MessageInspectors<...
  • Blog Post: Adding Custom SOAP Headers in WCF

    First, you need to decide whether to create the custom header using the MessageHeader.CreateHeader method, or by extending the abstract MessageHeader class. Under the hood, the CreateHeader method returns an instance of an internal class called XmlObjectSerializerHeader, which uses a serializer to write...
  • Blog Post: DefaultNetworkCredentials in Windows Store Apps

    Disclaimer: I'm still getting acquainted with Windows Store Apps, so I could be totally wrong; proceed with caution. It's been a while since I last wrote a blog post, and it's 4 AM right now, this may give you an idea why I had to get this out. Hopefully I may save poor souls that are destined to...
  • Blog Post: WCF Service Throttling

    Throttling, generally speaking, is tricky. Get the limits low and you may be prone to DoS and clients timing out trying to connect to your service in vain; Get them high and you may end up with an overloaded service that’s eating up machine resources until it crashes. There’s a sweet spot in between...
Page 1 of 1 (5 items)