Welcome to MSDN Blogs Sign in | Join | Help

Just a pointer towards an upcoming webcast session on COM+ Integration (and peer to peer support) in WCF. I have worked with Shawn on a few topics and he certainly knows his stuff, as I’m sure his book shows, so this should be good. For me, I’ll be interested to see how an external voice presents the feature...

Register here

With the release of Vista and WCF well behind us, we are deep into planning for our next generation of distributed application technology. We’re throwing around some fine ideas on how to transform the space but we really need more great technical talent to help design and build out the next platform. If you have broad experience in designing and building distributed applications and a strong understanding of customer needs then we'd like to speak to you.

We have some specific program management opportunities on the Distributed Application Server team such as:

and across the Connected Systems Division we have several other open positions in development and program management. If you or someone you know is interested in growing his/her career in Microsoft, please send email to our recruiter, Kerry Van Voris - kerryv@microsoft.com.

As you are probably aware, the Windows Communication Foundation runtime cares little about the process that is hosting it. With the WCF COM+ Integration feature we take advantage of this to offer a “COM+ hosted” mode (see documentation for the other two).

This is really our optimal, low dependency case and I’ve attached a sample to demonstrate how to achieve this for a simple component.

The key points that this demonstrates are as follows:

  • The WCF services are hosted in-process with an unmodified Enterprise Services component – there is no cross-process communication to call into the component and the component is blissfully unaware that the communication is happening over web services
  • The app offers the same contract on TCP and HTTP endpoints simultaneously:
    • the HTTP binding (wsHttpBinding) provides a broadly interoperable binding and builds on http.sys infrastructure without any IIS dependency
    • the TCP binding (netTcpBinding) provides with fewer of the WS* standards (WS-ReliableMessaging is not required to establish a session) and uses an efficient transport with the WCF binary encoder
  • The app provides the familiar HTTP/HTML help page again hosted directly from the COM+ app

Full source and initial draft instructions are in the zip.

This will make its way into the SDK over time but for now, comments / suggestions / bug reports are certainly welcome.

Thanks to everyone who attended Thursday’s TechEd session on “Windows Communication Foundation: Integrating with COM+ and MSMQ Applications”. We have taken a very pragmatic approach to integration and it’s always great to hear positive feedback directly from customers in the session and in the TLC area conversations throughout the week.

I’ve attached the slides, an instruction document and the full source code. Excel '97 is not strictly required - Clippy can do rich web services but more recent Excel versions will work just as well.

Let me know if you have any issues with the samples or if there is anything that I can clarify.

Dino has a post on the potential for WCF to IBM Mainframe CICS interop. The cross-vendor support for common specifications is of course a key benefit of web services and this release seems like a good step forward for some critical line-of-business processes. I hope that in time the interop between the two systems will be glitch free.

I would like to offer an alternative approach for customers using the Transaction Integrator from Microsoft Host Integration Server 2004. If you have the transaction integrator configured today to provide transactional access to your host systems, the COM+ Integration features of the Windows Communication Foundation can work with your transaction integrator components to give a similarly rich web service capability.

With about 5 minutes of configuration you can add WS-AtomicTransaction support for your host system without any additional host footprint and you'll get great interop for WCF and other web service clients.

I am interested in hearing from customers who would like to prototype or deploy this. With the WinFX Beta 2 release out there, everything should be in place to make this happen.

Head over to the Windows Vista, Windows SDK and WinFX Beta site to get all the goods for building Windows Vista and WinFX apps. This does include the WinFX Runtime Components - Beta2 so you can start using some very recent bits, samples and docs from the Windows Communication Foundation team.

Feedback on that is always welcome.

Don't forget the transactions hotfix mentioned in the last post.

With the imminent release of WinFx Beta 2, we have posted some updated hotfixes that are required for WCF’s WS-AtomicTransaction support or the COM+ Integration features. They are available from the download center for Windows XP and Windows Server 2003.

For specific package details you can reference the following knowledge base articles:

Now I know that you didn’t really read those but that’s probably okay.

You should only apply these if you explicitly need the functionality and these supersede the fixes required for previous releases of WinFX.

No updates are required for Windows Vista Beta 2.

Given the near term focus of the TechEd conference, the breakout session coverage of Windows Communication Foundation and other connected systems technology was relatively light last year. This year, things are lining up to be very different. In the connected systems track we have over 40 sessions scheduled.

I will be presenting the following talk…

Title: (WinFX) Windows Communication Foundation: Integrating with COM+ and MSMQ Applications

Abstract: The Windows Communication Foundation provides a rich future for connected systems, but how can you get there from today's deployed distributed applications? This session presents a typical distributed application using COM+ and MSMQ, and shows how you can use WCF integration features to help preserve existing investments. At the same time, learn how WCF offers a staged upgrade path to a more service oriented and interoperable application.

Timeslot: Thursday, June 15 9:45 AM - 11:00 AM

If you’re using COM, COM+ and MSMQ today in distributed apps then I hope to convince you that you’re probably in a good place for WCF adoption and not cul-de-sac bound.

The slides and demos are not locked down (I’m working on an IT Pro manageability aspect right now) so feedback, content requests and questions are welcome prior to this.

Note that this post is my first using the very slick Word 2007 “Blog Post” feature – if this post looks good then I love the feature. If it turns out “challenged” then I’ll report some bugs.

To date, the tooling available to enable and configure interoperable WS-AtomicTransaction in Windows Communication Foundation and MSDTC has been less than ideal with a number of issues that have been detailed in previous release notes.

With the upcoming WinFX CTP, this should get a whole lot better with two significantly redesigned pieces.

Firstly the Microsoft Management Console plugin that appears next to the DTC pane has been entirely redesigned.

We have reorganized the UI into clear sections for network configuration and security, transaction timeouts and a sub-dialog for controlling the granularity and types of traces and control over the session that will capture these events. Screen grabs from a recent build follow:

        
        

With the exception of the trace session control, the configuration will work locally or remotely.

This UI component (WsatUI.dll) is included in the Windows SDK with the rest of the WinFX SDK tools. It is not installed into the MMC by default so you do need to register it as follows:

        regasm /codebase WsatUI.dll

There is a similar set of capabilities at the command-line. I will point out that this does not include that logging session control since that is already covered by the existing platform tool LogMan.exe and we have moved away from requiring base64 hashes to identify certs to the much more standard thumbprints. Other than that hopefully configuration should be fairly clear when coupled with the tool documentation. Anyway, The new syntax is as follows:

Microsoft (R) WS-AtomicTransaction Configuration Utility
[Microsoft .NET Framework, Version 3.0.4024.0]
Copyright (c) Microsoft Corporation.  All rights reserved.

Utility to configure WS-AtomicTransaction network support

 -- OPTIONS --

-network:{enable|disable}         Enables or disables the WS-AtomicTransaction
                                  network support
-port:<portNum>                   Sets the HTTPS port for WS-AtomicTransaction
-endpointCert:{machine|<thumb>|   Uses the machine certificate or another
         "Issuer\SubjectName"}    local endpoint certificate specified by
                                  thumbprint or Issuer\SubjectName pair. Use
                                  {EMPTY} for the subject name if it's empty.
-accounts:<account,>              Specifies the comma-separated list of accounts
                                  that can participate
-accountsCerts:{<thumb>|          Specifies the comma-separated list of thumbprint
         "Issuer\SubjectName",}   or Issuer\SubjectName identifiers for the
                                  certificates that can participate. Use {EMPTY}
                                  for the subject name if it's empty.
-timeout:<sec>                    Specifies the default timeout in seconds
-maxTimeout:<sec>                 Specifies the maximum timeout in seconds
-traceLevel:{Off|Error|Critical|  Sets the trace level
            Warning|Information|
            Verbose|All}
-traceActivity:{enable|disable}   Enables or disables the tracing of activity
              events
-traceProp:{enable|disable}       Enables or disables the tracing of propagation
              events
-tracePII:{enable|disable}        Enables or disables the tracing of personally
                                  identifiable information
-show                             Shows the current WS-AtomicTransaction
                                  protocol settings
-restart                          Restarts MSDTC to make changes active
                                  immediately. If not specified, the changes
                                  will take effect when MSDTC is next started.

Feedback on the updated tools is always welcome but time is getting tight...

For the last couple of years, I have been working within the COM+ team, within the broader Windows Communication Foundation ("Indigo") team and, as documented here, this has primarily involved the cat herding of COM+ Integration and a handful of supporting COM+ Vista features. Well, we’ve added in our last few features:

  • object reference parameter support for the ADO users
  • sessionless binding support for the basic profile users
  • broader VARIANT UDT support
  • a cleaner extensibility model without surrogates

I'll post more about these in the near future but, subject to any last minute high priority requests (very high bar), we are about done with COM+ Integration for WCF V1.0.

With these completing, as of a few months ago, I have picked up additional program management responsibilities for transaction support in WCF. For WCF v1.0, this bag includes WCF transactions, WS-AtomicTransaction support, WCF transaction configuration tools and System.IO.Log.

Takeaway: expect more transactions stuff and I’m interested in any feedback or questions on the transaction capabilities.

Until then, check out my transaction team colleagues: Max, Florin & Jim.

I have had some questions around how to use COM+ Integration's "COM+ hosting mode" usually with the goal of using other, faster transports than HTTP. This post will demonstrate exactly how this can be done with no new code using the IIS hosted “Integrating with a COM+ Application as a Windows Communication Foundation Service” sample from the January CTP SDK as a starting point. The steps to go through are as follows:

 

1)     Uninstall the IIS hosting

2)     Reconfigure the calculator app

3)     Generate the default COM+ hosted namedpipes binding

4)     Edit the client configuration to use the namedpipes binding – stop there if that is what you want

5)     Edit the server’s namedpipes binding to TCP

6)     Edit the client configuration to use the TCP binding

 

 

1) Uninstall the COM+ IIS hosting with the ComSvcConfig tool as follows:

 

ComSvcConfig.exe /uninstall /application:ServiceModelSample

/contract:ServiceModelSample.esCalculator,ICalculator /hosting:was

/webDirectory:ServiceModelSamples /mex /verbose

 

Expected output:

Microsoft (R) COM+ Service Model Integration Configuration Tool

[Microsoft (R) .NET Framework, Version 2.0.50727.154]

Copyright (c) Microsoft Corporation. All rights reserved.

 

Removed endpoint for interface ServiceModelSample.esCalculator,ICalculator.

Updated file: C:\inetpub\wwwroot\ServiceModelSamples\web.config

 

2) To reconfigure the calculator app, modifying the ServiceModelSample properties and set it to be a “Server application” on the Activation tab in the COM+ MMC. On the Advanced tab, set the Server Process Shutdown to “Leave running when idle”

 

3) Generate the default COM+ hosted namedpipes binding using the ComSvcConfig tool as follows:

 

ComSvcConfig.exe /install /application:ServiceModelSample

/contract:ServiceModelSample.esCalculator,ICalculator /hosting:complus

/verbose

 

Expected output:

Microsoft (R) COM+ Service Model Integration Configuration Tool

[Microsoft (R) .NET Framework, Version 2.0.50727.154]

Copyright (c) Microsoft Corporation. All rights reserved.

 

Generated endpoint for interface ServiceModelSample.esCalculator,ICalculator.

Created directory: C:\Program Files\ComPlus Applications\{e146e066-d3d1-4e0e-b175-30160bd368de}\

Created file: C:\Program Files\ComPlus Applications\{e146e066-d3d1-4e0e-b175-30160bd368de}\application.config

Created file: C:\Program Files\ComPlus Applications\{e146e066-d3d1-4e0e-b175-30160bd368de}\application.manifest

Warning: COM+ application ServiceModelSample should be restarted for configuration changes to take effect.

 

Using the COM+ MMC, “Start” the application and the ball should spin without error.

 

 

4) Edit the client’s configuration file (app.,config) to use the corresponding namedpipes binding with the address matching the configured service address:

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

   <system.serviceModel>

     <client>

        <endpoint name="" address="net.pipe://localhost/ServiceModelSample/ServiceModelSample.esCalculator/ICalculator" binding="netNamedPipeBinding" bindingConfiguration="comNonTransactionalBinding" contract="ICalculator"/>

     </client>

     <bindings>

        <netNamedPipeBinding>

          <binding name="comNonTransactionalBinding"/>

          <binding name="comTransactionalBinding" transactionFlow="true"/>

          <binding name="comMexBinding"/>

        </netNamedPipeBinding>

     </bindings>

   </system.serviceModel>

</configuration>

 

At this point you should be able to rerun the client and observe the same output as before but the traffic is flowing over the namedpipes transport:

 

Add(100,15.99) = 115.99

Subtract(145,76.54) = 68.46

Multiply(9,81.25) = 731.25

Divide(22,7) = 3.14285714285714

 

Press <ENTER> to terminate client.

 

 

5) Edit the server’s configuration file (%PROGRAMFILES%\ComPlus Applications\{e146e066-d3d1-4e0e-b175-30160bd368de}\application.config) to change from a namedpipes binding to a TCP binding:

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

   <system.serviceModel>

     <behaviors/>

     <comContracts>

        <comContract contract="{C551FBA9-E3AA-4272-8C2A-84BD8D290AC7}" namespace="http://tempuri.org/C551FBA9-E3AA-4272-8C2A-84BD8D290AC7" name="ICalculator">

          <exposedMethod name="Add"/>

          <exposedMethod name="Subtract"/>

          <exposedMethod name="Multiply"/>

          <exposedMethod name="Divide"/>

        </comContract>

     </comContracts>

     <services>

        <service type="{E146E066-D3D1-4E0E-B175-30160BD368DE},{BE62FF5B-8B53-476B-A385-0F66043049F6}">

          <endpoint address="net.tcp://localhost/ServiceModelSample/ServiceModelSample.esCalculator/ICalculator" bindingConfiguration="comNonTransactionalBinding" binding="netTcpBinding" contract="{C551FBA9-E3AA-4272-8C2A-84BD8D290AC7}"/>

        </service>

     </services>

     <bindings>

        <netTcpBinding>

          <binding name="comNonTransactionalBinding"/>

          <binding name="comTransactionalBinding" transactionFlow="true"/>

          <binding name="comMexBinding"/>

        </netTcpBinding>

     </bindings>

   </system.serviceModel>

</configuration>

 

Using the COM+ MMC, “Shut down” then “Start” the application to apply to updated configuration and again the ball should spin without error.

 

6) Edit the client’s configuration file (app.,config) to use the corresponding TCP binding with the address matching the configured service address:

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

   <system.serviceModel>

     <client>

        <endpoint name="" address="net.tcp://localhost/ServiceModelSample/ServiceModelSample.esCalculator/ICalculator" binding="netTcpBinding" bindingConfiguration="comNonTransactionalBinding" contract="ICalculator"/>

     </client>

     <bindings>

        <netTcpBinding>

          <binding name="comNonTransactionalBinding"/>

          <binding name="comTransactionalBinding" transactionFlow="true"/>

          <binding name="comMexBinding"/>

        </netTcpBinding>

     </bindings>

   </system.serviceModel>

</configuration>

 

At this point you should be able to rerun the client and observe the same output as before but the traffic is flowing over the TCP transport:

 

Add(100,15.99) = 115.99

Subtract(145,76.54) = 68.46

Multiply(9,81.25) = 731.25

Divide(22,7) = 3.14285714285714

 

Press <ENTER> to terminate client.

 

And you are done - you have COM+ hosting with your transport of choice. Any channel that supports sessions should work just fine. COM+ Integration over channels without sessions will be in the next CTP but more on that very soon.

As detailed on many other pages, the WinFX November Community Technology Preview is available for download and this time it works with the release version of Visual Studio 2005.

On the Windows Communication Foundation front and from a COM+ Integration perspective, there are a good number of changes in this build compared with the Beta 1 drop. In addition to a whole host of bug fixes, I've pulled together a top-level summary of the new features in no particular order...

  • As described in a previous post, the command-line COM+ Service Model Configuration Tool (ComSvcConfig.exe) has a simple wizard style user interface. This can be invoked from the Service Configuration Editor SDK tool - from the File menu, select Integrate / COM+ Application to get started.

  • The ComSvcConfig tool parameters have been modified to increase consistency with existing .NET Framework tools such as gacutil or regasm and the rest of WCF.

    What was:

      ComSvcConfig.exe add /application:ServiceModelSample
        /interface:ServiceModelSample.esCalculator,ICalculator
        /hosting:complus

    becomes:

      ComSvcConfig.exe /install /application:ServiceModelSample
        /contract:ServiceModelSample.esCalculator,ICalculator
        /hosting:complus

  • The ComSvcConfig tool generates more readable default paths that do not contain GUIDs.

    What was:

      <endpoint address=
    "http://localhost/Samples/BE62FF5B-8B53-476B-A385-0F66043049F6.svc" ...

    becomes:

      <endpoint address=
    "http://localhost/Samples/ServiceModelSample.esCalculator.svc ...

  • When generating a contract for a COM+ application, the ComSvcConfig tool supports selection of individual methods from an interface rather than only entire interfaces. This enables the developer to get partial support for interfaces where one or more of the methods uses object reference parameters. Previously the interfaces would have failed integration validation since integration doesn't support such tightly coupled patterns. The developer can now opt-in on a per supported method basis.

    For example, to select only the debit and credit operations from the IFinances interface:

      ComSvcConfig.exe /install /application:OnlineStore 
    /contract:ItemOrders.Financial,IFinances.{Credit,Debit} /hosting:complus

  • The configuration generated by the ComSvcConfig tool now includes a comContract section to store the configuration settings that are used at startup time to control the contract definition for the service. In this relase, this enables customization of the namespace of the contract and the exposed name for the contract - both of these were previously auto-generated and non-configurable. Clearly it also stores the individual methods that have been selected for inclusion on the contract.
      <comContracts>
        <comContract contract="{C551FBA9-E3AA-4272-8C2A-84BD8D290AC7}"
             namespace="http://tempuri.org/mySampleNamespace"
             name="ICalculator">
              <exposedMethod name="Add" />
              <exposedMethod name="Subtract" />
              <exposedMethod name="Multiply" />
              <exposedMethod name="Divide" />
        </comContract>
      </comContracts>
    
  • The WCF service moniker now supports retrieivng its contract at runtime using WS-MetadataExchange. This provides a zero-registration approach for COM-based clients that wish to use web services. Rather than requiring client-side installation of a service specific proxy assembly, a full WS-* (secure, reliable, transacted etc.) proxy will be built on-the-fly at runtime. This targets script and Office-based scenarios where full app deployment and registration is undesirable.

    For example, assuming that a WCF is installed, the following code is all that is required to invoke a remote service:

      Set myProxy = GetObject(
          "service:mexAddress=http://servername/Affiliates/service.svc/mex,
              address=http://servername/Affiliates/service.svc,
              contract=IAffiliate, contractNamespace=http://Microsoft.ServiceModel.Demo,
              binding=WSHttpBinding_IAffiliate, bindingNamespace=http://tempuri.org/")
      myProxy.Credit( "Andy", 35.99)
    
  • The COM+ Hotfix for "Indigo" is now required. It was previously optional but to provide correct behavior this is now mandatory.

  • Methods using User Defined Type parameters (the "struct" construct in COM typelibs) are now supported. This is a common pattern in Visual Basic 6.0 and is now in scope for integration. Support for passing UDTs within VARIANTs should come in a later release.
As always, I'm interested in any feedback, questions or issues that you might hit with the feature.
(or "The Wizard's Way from COM+ to Indigo")

As I have described here previously and as I have recently shown at the PDC, MVP and BPI events, the task of using the Windows Communication Foundation's COM+ Integration feature to produce a secure, reliable, transacted and interoperable service is not difficult. The typical syntax is as follows:

    ComSvcConfig.exe /install /application:BookSample
        /contract:BookLogic.Finance,IFinance /hosting:complus

This involves just a little bit of typing but it can get more wordy as more interfaces are included and explicit methods are specified. Now COM+ devs and admins are used to the glamor of the MMC and the incredible spinning balls UI so with Beta 2 of WCF there was scope for going beyond the command-line.

As a small part of the toolset that they are delivering with Beta 2 and beyond, the WCF Management Tools team have stepped up to bring some of the old UI magic back. A few of the screens follow (click for detail)...

Choose your component interface:

Choose the methods for the service contract (default to all):

Choose where you want to host the WCF service endpoints:

Kudos and thanks goes to Yizhan, Xiao and Justin from Alex’s remote team for making this a cool and easy thing.

Note: this is what we have for Beta 2 and is not the RTM version of the tool - there is still time to shoehorn some spinning balls in there somewhere.

Jurgen Postelmans has just posted a clear and concise example of using an Enterprise Services class with the Windows Communication Framework (forever "indigo") integration. He also mentions the method exclusion that we're adding for Beta 2 to address a specific customer concern. I'll note the complete set of  Beta 2 changes in an upcoming post.

While I'm at it I should definitely mention Paul Fallon's fine series of "Going for a walkabout with - VB6, COM, COM+, Transactions and Indigo" articles on integration. Over a series of 5 posts he discusses his experiences (he is a technical consultant in Ireland) of the real-world motivations for integration. He takes a vintage piece of Visual Basic 5 MTS code (circa 1998) and generates a corresponding WCF service with little effort - no C# required.

The last article, that I should have posted about a while ago, is Christian Weyer's example code from his TechEd 2005 session "My Home is My Castle: Hosting and Running Your .NET Applications". You may need a bit of context about the session but his very cool final advanced demo showed hosting a persistent WSE TCP endpoint in-process with a COM+ application (no DCOM required) using an initialization component. For those of you with a fairly deep understanding of the COM+ Integration feature of Indigo (that definitely includes Christian), let's just say that there are certain "similarities" in approach.

The complete code for the demos in the PDC session COM305 Windows Communications Foundation ("Indigo"): Integrating COM+ and MSMQ Applications is now available with a rough guide documentation here. These should all work on the "WinFX Runtime Components - September CTP". No smoke or mirrors required.

Do let me know if you have any issues in getting these running in your environments or if you have trouble generalizing the approaches to your own components, services and queues. We are still pre-Beta 2 so there is some time to fix important issues or cover cases that we've missed.