Sign in
MSDN Blogs
Microsoft Blog Images
More ...
Common Tasks
Blog Home
Email Blog Author
RSS for comments
RSS for posts
Atom
Search
Tags
.net
behaviors
configuration
datacontractresolver
datacontractserializer
errors
IIS
metadata
odata
paging
refreshsection
Serialization
svcutil
testing
wcf
webapi
websocket
wsdl
xmlserializer
xsd
Archives
Archives
February 2013
(1)
January 2013
(1)
July 2012
(1)
June 2012
(1)
February 2012
(1)
June 2011
(1)
September 2010
(1)
June 2010
(1)
May 2010
(1)
March 2010
(1)
January 2010
(1)
December 2009
(1)
November 2009
(3)
October 2009
(1)
August 2009
(1)
July 2009
(2)
June 2009
(3)
May 2009
(1)
April 2009
(4)
MSDN Blogs
>
Youssef M's Blog
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Youssef M's Blog
Paging with ASP.NET Web API OData
Posted
3 months ago
by
Youssef Moussaoui - MSFT
0
Comments
A common requirement for web applications is to expose partial results from a larger set of data. Maybe you want your users to be able to browse through a collection of movies that they can stream. But you don't want to display all of the thousands of...
Youssef M's Blog
Writing tests for an ASP.NET Web API service
Posted
3 months ago
by
Youssef Moussaoui - MSFT
5
Comments
It's important to test any service you write to make sure that it's behaving the way you expect it to. In this blog post, I'll go through the main ways of testing a Web API service, exploring the benefits and drawbacks of each option so that you can test...
Youssef M's Blog
Building Real-time Web Apps with ASP.NET WebAPI and WebSockets
Posted
10 months ago
by
Youssef Moussaoui - MSFT
2
Comments
WebSocket is a recent technology that provides two-way communication over a TCP connection. This allows us to create real-time web apps where servers can push data to clients. In this blog post, I’ll demonstrate how this can be done by building a simple...
Youssef M's Blog
Error Handling in ASP.NET WebAPI
Posted
10 months ago
by
Youssef Moussaoui - MSFT
6
Comments
WebAPI is a brand new framework that makes it easy to build HTTP services. As such, it provides several features that make it easy to send back useful and informative error messages in a variety of cases. In this post, I’ll go over some of these capabilities...
Youssef M's Blog
Writing a Lightweight Web Service using WebApi Building Blocks
Posted
over 1 year ago
by
Youssef Moussaoui - MSFT
1
Comments
Don’t you wish you could write a web service this easily: LiteWebServer server = new LiteWebServer ( "http://localhost" ); server.Get( "/Hello" , (r) => new HttpResponseMessage () { Content = new StringContent ( "Hello World!" ) ...
Youssef M's Blog
Using the [ContractNamespace] attribute to customize the namespace for POCO types
Posted
over 2 years ago
by
Youssef Moussaoui - MSFT
0
Comments
In .NET 3.5 SP1, DataContractSerializer was enhanced to support POCO types that weren’t marked with any serialization attributes at all. You can find my previous post about serializing POCO types here . But in some cases, you may want to customize...
Youssef M's Blog
Loading WCF Client Configuration from Different Files with ConfigurationChannelFactory
Posted
over 3 years ago
by
Youssef Moussaoui - MSFT
2
Comments
One pain point with configuration that WCF developers have run into in previous versions of the framework is the limitation that WCF clients can only use the hosting executable’s configuration file. This can be problematic for clients that...
Youssef M's Blog
Turning XML into XmlSerializer CLR Types with xsd.exe
Posted
over 3 years ago
by
Youssef Moussaoui - MSFT
0
Comments
Here’s a common dilemma .NET developers encounter when working with XML: I have some XML that I want to represent in a strongly typed way, but I don’t have any XSDs to represent that XML. How do I turn that XML into CLR types that I can serialize...
Youssef M's Blog
Using XML Schema Import and Export for XmlSerializer
Posted
over 3 years ago
by
Youssef Moussaoui - MSFT
0
Comments
In a previous post, I outlined how you could import and export the XML schema for a type that you’re serializing with DataContractSerializer. Here’s how to do the same thing if you’re serializing objects with XmlSerializer: static void RoundTripXmlMetadata...
Youssef M's Blog
How to get minOccurs = 0 in the schema for XmlSerializer struct members
Posted
over 3 years ago
by
Youssef Moussaoui - MSFT
4
Comments
If you try exporting the following type into an XML schema: public class Employee { public DateTime BirthDate { get ; set ; } } And you happen to be using XmlSerializer, you may be surprised to find that the schema gets exposed like...
Youssef M's Blog
How to Change .NET Configuration Files at Runtime (including for WCF)
Posted
over 3 years ago
by
Youssef Moussaoui - MSFT
5
Comments
One of the most common issues people run into with WCF configuration, and .NET applications in general, is that configuration files appear to be fixed. You only have one configuration file for an executable, and you can’t use different configuration files...
Youssef M's Blog
Behavior Merge in WCF 4.0 Configuration
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
4
Comments
One of the brand new configuration features you can find in the Beta 2 release of .NET 4.0 is the ability to merge behaviors in the configuration hierarchy. This should make it easier to manage behaviors when you want a set of common behaviors to be used...
Youssef M's Blog
Separating out WCF Configuration Into Multiple Files with configSource
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
1
Comments
WCF configuration files can sometimes be very, very long. And there’s a good reason for that too: WCF makes heavy use of configuration so that you can do just about anything you can do with code in a config file. I recently decided to estimate how much...
Youssef M's Blog
WCF 101: The Simplest WCF Example You'll Ever See
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
6
Comments
Every once in a while, I’ll encounter a developer that thinks that WCF is too complicated to use. Whereas in fact, the basics of WCF are incredibly simple. MSDN’s tutorial hides this fact by making their introduction to WCF a fairly long and painful 6...
Youssef M's Blog
Beta 2's out!
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
0
Comments
Ok, so a bit late, but the Beta 2 release of Visual Studio 2010 was released two weeks ago. With Beta 2 come a number of changes to the DataContractResolver, so I’ve finally found the time to update my previous post . For those that have read the post...
Youssef M's Blog
Reusing Types in Referenced Assemblies with svcutil's /r Switch
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
0
Comments
Everyone’s entitled to their own personal favorite svcutil switch, but mine is the “/reference” switch, or “/r” for short. It allows you to avoid generating a type again if it’s already present in a referenced assembly. Here’s how it works: Let...
Youssef M's Blog
Serializing Plain Old CLR Object (POCO) types with DataContractSerializer
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
0
Comments
When version 3.0 of the .NET framework shipped, DataContractSerializer could only support a few categories of CLR types. Sowmy has a good list of these that you can find here . The recommended model was to use DataContractAttributes on classes and structs...
Youssef M's Blog
Optimizing Away Repeat XML Namespace Declarations with DataContractSerializer
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
7
Comments
For performance reasons, DataContractSerializer can’t always figure out what namespaces will be used in a serialized instance ahead of time. And so, you may sometimes end up having a certain XML namespace defined over and over again when it only has to...
Youssef M's Blog
Comparing the Performance of .NET Serializers
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
7
Comments
The .NET framework comes with a variety of different serializers. Hopefully, my overview of these serializers will have provided some insight into the differences between them and the various advantages and disadvantages of using different serializers...
Youssef M's Blog
Setting Configuration Defaults with Nameless Elements in WCF 4
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
0
Comments
This is my second post about Beta 1 features in WCF 4.0 after introducing the DataContractResolver . Beta 1 introduces a new way of using WCF configuration. It’s now possible to specify a default for bindings, service behaviors, endpoint behaviors...
Youssef M's Blog
Customizing the XML for collections with XmlSerializer and DataContractSerializer
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
1
Comments
One of the most common requests I get about serialization is to explain how to get collections to serialize out one way or another to XML. Specifically, developers are interested in being able to manipulate the hierarchy level of the collection within...
Youssef M's Blog
Configuring Known Types Dynamically - Introducing the DataContractResolver
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
16
Comments
This post has been updated to account for the changes to the DataContractResolver in the Beta 2 release of .NET 4.0. This will be my first of several posts about new features that are showing up in the Beta 1 release of .NET 4.0. Beta 1 was released...
Youssef M's Blog
Configuring the Client Endpoint for svcutil
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
2
Comments
One of the more common questions I get is along these lines: I want to configure svcutil to use a particular binding. How do I do that? Usually, this happens for one of two reasons: 1) You’ve exposed your metadata with a secure binding...
Youssef M's Blog
Using XML Schema Import and Export for DataContractSerializer
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
2
Comments
For many WCF developers, service metadata import and export is a magical thing. You start your service with a serviceMetadataBehavior, set httpGetEnabled to true or add an IMetadataExchange endpoint, and metadata gets automatically generated for you....
Youssef M's Blog
Testing the performance of known types
Posted
over 4 years ago
by
Youssef Moussaoui - MSFT
2
Comments
In my last post , I claimed that one of the reasons you should try to avoid known types is that it significantly degrades performance. But you should never take anyone’s word about performance, so here’s an actual test comparing the performance of using...
Page 1 of 2 (27 items)
1
2