Thursday, July 13, 2006

"Programming with CTP's is like a box of chocolates..."

In preparation for what I'm sure will be an award-winning presentation on Sevice Factory, I am going back through all various tutorials and virtual labs since there is a bit of "mismatch" with the various drops and supporting technologies:

you need the Guidance Automation Extensions (GAX) and Guidance Automation Toolkit (GAT) to run Service Factory. The most recent drops of those are May 2006

The current ASMX Service Factory code-drop is July 2006.

If you want to use WCF, the most current drop of WinFX (SORRY, SORRY! .NET 3.0 Framework) is May 2006, however the latest Service Factory drop for WCF services only supports the Feb 2006 CTP of .NET 3.0 Framework (actually, back then it still was WinFX...) Per Don Smith, (whose blog is a must read if you want to stay up on things in the Service Factory world) a WCF factory for the June CTP is being built, and will be out sometime this year.

So, anyway, here's what I've been working with (all in a blindingly fast Virtual PC):


  • WinFX Feb 06 CTP
  • GAX and GAT May 06 CTP
  • WCF Service Factory May 06 Drop

The "interesting" thing to remember is that the GAX and GAT I have are the newest pieces, but not "entirely" compatible with the other two, meaning that there are a few breaking changes.


The first hideously deformed offspring from this un-holey alliance was delivered yesterday; I tried to use the Service Factory recipe to expose a service. After several minutes of chunking away, I was presented with a rather ugly error (OK, they are all ugly, but some are uglier than others), the meat of which was:

"Compiling transformation: 'System.CodeDom.Compiler.CompilerErrorCollection' does not contain a definition for 'Add'"

Gah! I had to wade through some forum posts (mostly people asking the same question) before I found the answer in the GAT forum. When the new drop of the GAT was pushed, a breaking change was introduced. The fix for this is to edit all of the T4 templates (no, I don't know what T4 stands for) which are located (usually) in \Program Files\Microsoft Service Factory\Guidance Packages\WCFGuidancePackage\bin\T4. There are five files. To fix this problem, you need to add the following line near the top to all of them:

<#@ Assembly Name="System.dll" #>

That takes care of that.


The only other issue I've found so far is minor; in the wizard you cannot set a method of a Service Contract as "IsInitiating" unless you mark the service contact as "Requires Session." A few minor code changes by hand, and your good again. This does raise another issue I am trying to work though however; Service Factory provides recopies for almost everything, including exposing your service in a host application (for testing). Part of the recipe is selecting a binding type via a drop down list. The only option for this I get is basicHttpBinding, which does not support sessions. Not a huge deal, I just need to go change is to WsHttpBinding by hand. But, it would be nice if I didn't have to dig through the web.config myself. The documentation does speak of an "Advanced Configuration Editor" and maybe that's where you can choose other binding options. The package I would need to download this is no longer available for download however. So, for now, I may be on my own. I'll re-post if/when I learn more.

No comments: