Saturday, August 11, 2007
Christian Weyer has an article on MSDN Mag together with Steve Maine and Dominick Baier about using Windows Process Activation Service (WAS) for non http protocols. Actually it's about much more than that, but that is what I found interesting. Hosting WCF services in WAS gives you the possibility to use NetTcp, Named Pipes and MSMQ protocols. For more info about WAS you should read the article. Anyway, using WAS as a host for WCF services sounds like a good idea. You don't have to create and maintain your own NT Service and you get stuff like "on-demand activation, process health monitoring, enterprise-class manageability and rapid failure protection" for free. But then you also get some lifetime management "features":

"...WAS does demand activation (as you know, the "A" in "WAS" stands for activation). This means that the application domain hosting a service only gets created when a request message comes in. Application domains shut down again after a configurable idle period. There are also several reasons why WAS or the ASP.NET runtime may decide to recycle the application domain or even the whole worker process."
So I suspect there would be some overhead of creating and shutting down the app domain, unless you can set the idle period to infinite of course. And then you have the recycle bit... Hmmm.... Do I want that?

If I were asked: "WAS or NT Service?", I think I'll go for the NT Service, unless there's something I totally missed out on here... which definitely could be the case <smile>.

If you want to try this out you might find these code samples interesting in addition to the article mentioned.
.Net | IIS | WCF
Saturday, August 11, 2007 1:46:31 AM (W. Europe Daylight Time, UTC+02:00)
 Saturday, April 14, 2007
Just a reminder for MSDN Live in Bergen the 23rd of April. This time Microsoft have joined forces with Norwegian .Net User Group and me and John St. Clair are speaking at the last session of the day. I will talk about migration to WCF and John will do Debugging, Tracing, and Administration: Tips & Tricks. Here you'll find details about the "NNUG Agenda".

Events | Microsoft | NNUG | WCF
Saturday, April 14, 2007 11:39:30 AM (W. Europe Daylight Time, UTC+02:00)

Just found this whitepaper from Saurabh Gupta at Microsoft comparing different messaging technologies to WCF. Very nice! I have been doing some perf testing myself to justify (don’t ask!) migration to WCF. I will add my results to my blog when I’m finished. First I need to convince management to agree to the migration.

WCF
Saturday, April 14, 2007 11:26:55 AM (W. Europe Daylight Time, UTC+02:00)
 Saturday, March 10, 2007

NNUG.jpgGreat news! We have invited Christian Weyer from ThinkTecture to speak at NNUG in Oslo, Bergen and Kristiansand. I’m really looking forward to this. Christian is a well known speaker and especially known for his excelent expertise in SOA.

I had the opportunity to see him talk at TechEd in Barcelona last year, and this guy really knows his stuff. Come to our meeting in Bergen at May 30th and please tell all your friends and co workers!  For those of you not living in Bergen, he will also talk in Oslo the 29th and Kristiansand the 31st. More info will be available at NNUG later.

Events | NNUG | WCF
Saturday, March 10, 2007 2:56:26 PM (W. Europe Standard Time, UTC+01:00)
 Thursday, January 04, 2007
At work at the moment I’m trying to calculate the migration complexity of our software from .net framework 1.1 to 3.0, with main focus on WCF. Specifically I’ve been doing some test migration of web services to WCF and regenerating our DTO’s to support data contracts. During this test migration an interesting issue came up. With our “old” web services we did our own serialization of DTO’s. Several reasons for that, which I’m not going into now, but this was a bit problematic in WCF at first. I’ll show you a quick example of a typical web service at my company:

[WebMethod]
public XmlNode GetSomeData() {
    return StaticBusiness.GetSomeData().Serialize2XmlNode();
}

In the example I just do a call to a static business method called GetSomeData. The return value from this method (which is one of our DTO’s) is then serialized to an XmlNode by calling Serialize2XmlNode().

In WCF we do not want to handle serialization by our self, so we want WCF to take care of this for us and choose the best serialization mechanism available. So our service in WCF would look something like this:

[ServiceContract()]
public interface IMyService {
    [OperationContract]
    SomeDataObject GetSomeData();
}

public SomeDataObject GetSomeData() {
    return StaticBusiness.GetSomeData();
}

One of the reasons why we did our own serialization in 1.1 was lack of xml serialization support for circular references, but in WCF this is no longer an issue.

So as long as my SomeDataObject  has a data contract it will be serialized and returned to the caller. As you probably have guessed we also de-serialized our DTO’s on the client side (since we returned an XmlNode), but that is now of course handled by WCF. Since we did our own serialization we were not dependent on proxy generation of our DTO’s and we could just reuse the dll on the client side. In our case we had .net on both sides so this was ok. In 1.1 we did it like this:

return SomeDataObject.DeSerialize(MyWebService.GetSomeData());

So I was trying to find a simple way of doing this in WCF. The solution was much simpler than I’d ever expected. By manually generating the proxy and using the /r parameter I was able to bypass proxy serialization of DTO’s. Fantastic!

So a typical call to svcutil would look like this:

svcutil /nologo /out:Proxy.cs /r:C:\Test\DTOs.dll /config:App.config /namespace:*,MyProxies net.tcp://localhost:9000/MyService/tcpmex


This gives me a proxy called Proxy.cs and with my method looking like this:

public DTOs.SomeDataObject GetSomeData
{
    return base.Channel.GetSomeData();
}


This solved a great challenge for us. My next task at hand is to do some performance testing and see if we get the desired performance improvements by using NetTcp as appose to POWS (Plain Old Web Service).

Thanks to Rick Strahl for his great blogpost on this subject.
.Net | WCF
Thursday, January 04, 2007 12:34:29 AM (W. Europe Standard Time, UTC+01:00)