first_page

A Monday Table of WCF Links

Today I have way more WPF links than WCF—so I’ll take the easy way out:

Sahil Malik: “[Host a WCF Service in IIS 7 & Windows 2008](http://blah.winsmarts.com/2008-4-Host_a_WCF_Service_in_IIS_7_-and-amp;_Windows_2008_-_The_right_way.aspx)” This is the important but mysterious command line:

"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r –y

“[The Visual Basic Team: A Walkthrough of WCF Support in Visual Studio 2008](http://blogs.msdn.com/vbteam/archive/2007/08/30/A-Walkthrough-of-WCF-Support-in-Visual-Studio-2008.aspx)” “To enable proxy type reuse, simply add a reference to `NorthwindBu``s``i``nessObjects` in our client project. Then right click the `ServiceReference` node in solution explorer, and select **Update…**. This will update the service reference, regenerating the service proxy. Since by default we scan all project references for types to reuse, the generated proxy will now expose the datatables from our `NorthwindBusi``nessObjects` project.” This was the big news for me. It made my WCF life livable…
“[Sharing Types Between WCF Service and Client](http://www.codeproject.com/KB/WCF/WcfTypeSharing.aspx)” “If you use the same type in more than one service, the generated client code may have multiple definitions for the same type…”
“[DuckTyping: Runtime Dynamic Interface Implementation](http://www.codeproject.com/KB/cs/nduck.aspx)” This subject became important to me when I mistakently found it necessary to ‘reattach’ an interface to a WCF `[DataContract]` composite. This was a mistake because I was not aware of proxy-type reuse.
“[Using base types in WCF](http://www.thejoyofcode.com/Using_base_types_in_WCF.aspx)” “Sadly, the proxy that’s generated when you expose an interface exposes a parameter of type `object` and not `IEntity`—which doesn’t exactly create the best looking API. However, if we use an actual class then the proxy exhibits the appropriate parameter type.” This, again, turned out to be a non-issue for me (because of proxy-type reuse).
“[Multiple WCF Endpoints & .NET 2.0 Clients](http://www.schnieds.com/2008/08/multiple-wcf-endpoints-net-20-clients.html)” “In cases where you might want to expose multiple endpoints for the same .svc endpoint, you can use relative addressing. This example illustrates a case where clients can access the same Service.svc endpoint using `BasicHttpBinding` or `WSHttpBinding` to support different Web service protocols.” …great to know that it’s possible.
“[What’s In a WCF Binding, And What Can My Service Do Right Now?](http://blogs.msdn.com/kaevans/archive/2008/01/09/what-s-in-a-wcf-binding-and-what-can-my-service-do-right-now.aspx)” “The `basicHttpBinding` indicates that your service can ‘talk’ over HTTP and exchange text. It doesn’t get all of the `WS-*` goodness, like WS-Addressing, WS-Security, or WS-ReliableMessaging, it just talks text over HTTP according to the WS-I Basic Profile 1.1. This is basically the same thing that ASMX web services ‘speak’: they can only talk HTTP with text.”
“[Problem with Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ScriptHandlerFactory'](http://forums.iis.net/p/1158851/1908679.aspx)” “As the error message indicates , there are duplicate collection entry. You can try add the following section at the beginning of the handler section:<remove name="ScriptHandlerFactory"> ”—Leo Tang
Aaron Skonnard: “[DataContracts without attributes (POCO support) in .NET 3.5 SP1](http://www.pluralsight.com/community/blogs/aaron/archive/2008/05/13/50934.aspx)” “One of the new WCF features in .NET 3.5 SP1 is that `DataContractSerializer` now supports serializing types that aren’t annotated with any serialization attributes like `[DataContract]` or `[Serializable]`. …The support for `[Serializable]` provided a nice migration path for traditional .NET Remoting types, which was nice, but the lack of support for POCO types meant you couldn’t move your ASMX types over to the `DataContractSerializer` without sprinkling a bunch of new attributes on them.” I’m guessing that this is how proxy-type reuse is possible—but I still use `[DataContract]`.
“[WCF’s NetDataContractSerializer](http://www.pluralsight.com/community/blogs/aaron/archive/2006/04/21/22284.aspx)” “As of the Feb CTP, the WCF team decided to split these two modes into separate classes—so now you have `DataContractSerializer` (`SharedContract`) and `NetDataContractSerializer` (`SharedType`). The WCF folks want to encourage folks to use the “shared contract” model as much as possible so the DCS is the default serializer throughout the framework—contracts always use DCS unless overriden with a serializer format attribute.”
“[WCF Serialization part 1: Interfaces, Base classes and the NetDataContractFormatSerializer](http://weblogs.asp.net/avnerk/archive/2006/07/31/WCF-Serialization-part-1_3A00_-Interfaces_2C00_-Base-classes-and-the-NetDataContractFormatSerializer.aspx)” “It seems the standard `DataContractFormatSerializer` has a shy little brother called the `NetDataContractFormatSerializer`. The ‘Net’ here, like in other parts of WCF, means ‘.NET’. This is a formatter than can be used when both ends of the stream are running .NET, and it can thus embed the type information in the serialized blob. This makes all the fudging around with knowntypes completely unneccesary, and gives us the flexibility we had with earlier methods.”

rasx()