Monthly Archives: January 2009

Consuming DFS WSDL in Visual Studio

Earlier today I posted to EDN a new sample project that demonstrates consuming DFS web services directly from their WSDL in a Visual Studio 2008 environment. Right up front, I want to credit my colleague John Sweeney, who really should start blogging, with providing the original work contained in this sample. My subsequent contribution was mostly UI/UX-related. Thanks, John!

After downloading and extracting the sample to your local development machine, open the solution in Visual Studio 2008. The default code assumes that you’re running the DFS web services locally (i.e. IP and port 8080). You should, of course, modify the IP address and port to match your particular development environment.

Main sample UI

The main intent of this sample is to demonstrate various ways to authenticate via DFS. It’s worth noting that this sample doesn’t cover single sign-on (SSO) support in DFS, nor does it cover WS-Security header-based authentication. Good demos to be certain…

As the user interface (UI) above tries to clearly state upfront, content repository (aka Docbase) name cannot be null or empty, regardless of authentication approach. Given authentication via ServiceContext header, user name and password cannot be null or empty. Given authentication via ContextRegistry runtime service, when token is null or empty, user name and password cannot be null or empty, and when user name and password are both null or empty, token cannot be null or empty.

One thing that is still a bit obscure in the current UI is that authentication via DFS can be a two-step or one-step process, depending on the situation. If you choose “Via ContextRegistry…” and a Context Registry token isn’t provided to DFS, two runtime service invocations will be made. In all other cases, there is one service invocation.

Assuming that your connection details are valid given your authentication approach, this sample will (a) retrieve a repository list, (b) retrieve cabinets, and (c) retrieve content (i.e. transfer MenuItemTemplate.ini to your desktop).

A previous direct-to-WSDL DFS consumer sample I posted, targeted .NET 3.0 and WCF "v1." This sample targets .NET 3.5 and WCF "v2" instead, along with support for Silverlight 2. It accomplishes this change via LINQ to XML (e.g. leverages System.Xml.Linq.XDocument instead of System.Xml.XmlDocument).

If you need to target this sample at .NET 3.0, in addition to adjusting the project build properties, removing the project reference to the System.Xml.Linq.dll assembly, and removing the System.Xml.Linq namespace declaration in ServiceContextHeader.cs, you’ll need to change the relevant code within OnWriteHeaderContents. For example:

  XDocument doc = null;
  using (StringWriter sw = new StringWriter(CultureInfo.CurrentCulture))
      XmlSerializer xs = new XmlSerializer(typeof(ServiceContext));
      xs.Serialize(sw, serviceContext);
      doc = XDocument.Load(new StringReader(sw.ToString()));

would become:

  XmlDocument doc = null;
  using (StringWriter sw = new StringWriter(CultureInfo.CurrentCulture))
      XmlSerializer xs = new XmlSerializer(typeof(ServiceContext));
      xs.Serialize(sw, serviceContext);
      doc = XmlDocument.LoadXml(new StringReader(sw.ToString()));


Although, it’s not currently employed in the sample, there is also code to add a ContentTransferProfile to the ServiceContext header.

As always, consult the DFS Developer Guide for complete details on everything that may be passed in the ServiceContext header.

I do expect that this sample will be incorporated into the DFS SDK and DFS technical publications content; however, I wanted to get this into your hands sooner rather than later. Cheers…


After reading Simplexity: Why Simple Things Become Complex (and How Complex Things Can Be Made Simple), I find myself taking pause. It’s harder than usual to coalesce my thoughts.

Complexity figure

This book is an easy enough read, but it’s also a bit disconnected. As author Jeffrey Kluger suggests, “simplicity and complexity may masquerade as each other,” but I’m still left feeling like the mask hasn’t been adequately identified or removed. Perhaps I expected too much from the text. After all, as the author points out, complexity research is still a young scientific pursuit–an unsettled (formative) field. If the science is young, the pop science equivalent seems all the more premature.

I do have a few take-aways to share from my read, though:

  • View a conference as a group of people exchanging information and insights, keynoting ideas and tempering whatever action is eventually taken by exploring lots of options first. Conferences are indeed great opportunities for milling and annealing–it’s the networking, stupid! Thanks to Simon Guest and his vision to bring open space to events like the Microsoft MVP Global Summit and the Microsoft Strategic Architect Forum (SAF), I’m surprised that more conferences don’t feature open space more prominently.
  • With respect to social signaling, signaling abilities are influenced from building group connections. For example, a signaler you know well becomes more persuasive than a signaler you don’t. The amount of time your spend with other individuals changes their ability to influence you and your ability to influence them. (I realize that this take-away is rather obvious, but it bears (personal) repeating.)
  • Referring to work by Mark Gottfredson and Keith Aspinall, I appreciated becoming aware of a so-called Model T analysis to find one’s innovation fulcrum and stay perched there upon the respective complexity arc.
  • Having seen the power of strongly held beliefs myself, I appreciated the following turn of words in evidence of complexity confusion: “The entrenched anthropology of the place, however, turned out to be more powerful than the new lessons.”
  • “A bunch of isolated [sports] conferences is like a bunch of isolated economies. If you don’t allow them to mix, they stay primitive because you have no way of comparing them.” -Ken Massey (For example, will CMIS impact the ECM industry in ways similar to inter-league play in MLB?)
  • “We pride ourselves on being the only species that understands the concept of risk, yet we have a confounding habit of worrying about mere possibilities while ignoring probabilities, building barricades against perceived dangers while leaving ourselves exposed to real ones.” (So, what do you confuse for a snooze alarm that should be a wake-up call, or vice versa? What is only temporarily agitating that deserves longer-lasting follow-through? What is over- or under-thought?)
  • “The nature of people who love electrons and bits is very different from the nature of people who love atoms.”
  • “If you have to ask what jazz is, you’ll never know.” -Louis Armstrong

Toward the end of his work, Mr. Kluger states: “Understanding the hard science of a thing is not always the same as being able to make any use of that knowledge.” I still need to understand the hard science of complexity (e.g. go beyond software engineering’s essential complexity versus accidental complexity debates). Simplexity wasn’t my ticket to this performance.

An MVP again

Thank you, Microsoft, Simon and Miha, for awarding me Solutions Architect MVP status once again. I’m especially grateful that you listened to this group of architects and worked with us to bring this program back (even better!) after a relatively brief hiatus.

Update 12/30/2009: This year saw substantial change yet again to the MVP program where an architect/architecture focus is concerned. (Yeah, I’m going “light,” Miha. :-) ). I’m an architect not an evangelist, and the manner in which I influence doesn’t align well with the MVP program’s orientation; so, I’ve learned that I will not be renewed as an MVP in 2010. Nevertheless, I appreciate being involved in this program and wish it well.