December 2005 - Posts

WCF/Indigo … surviving the port warp from BETA-1 … log #6: Duplex Communication

Another hurdle to cross is duplex communication. While I will document the problem and the resolution, I am not as yet sure what actually changed from BETA-1 where the resolution was not required. I will update this post as soon as I have figured out what has changed under the bonnet.

Scenario:

You have a contract with a callback interface, i.e. a duplex communication, for example:

[ServiceContract(CallbackContract = typeof(ICalculationResult), Namespace = "http://www.bbd.co.za/IndigoCompanionSolution")]
    public interface ICalculationRequest
    {
        /// <summary>
        /// Calculation request, passing calculation request which defines values and operation
        /// </summary>
        /// <param name="request"></param>
        [OperationContract(IsOneWay = true)]
        void Calculate ( CalculationRequest request );

        /// <summary>
        /// Debugging ping of service method
        /// </summary>
        /// <param name="caller">caller id</param>
        /// <returns>Hello + caller id</returns>
        [OperationContract(IsOneWay = false)]
        string Ping(string caller);
    }

Issue:

In BETA-1 we created the channel to the service, hosted in IIS, implementing the contract and the consumer and service chatted happily ever after. With WinFX BETA-2, on XP ... it worked on Windows 2003 for some strange reason ... the same code, same configuration, fails with the error "HTTP could not register UTL http://+;80/Temporary_Listen_Addresses/GUID-OMITTED/ because TCP port 80 is being used by another application".

Feedback from Microsoft:

"The behavior you are witnessing is to be expected.  In a duplex exchange, the service will open an HTTP connection back to the client, and, by default, the base address where the client will be listening will be the same as the base address where the service is listening.  Hence, in your case, the client will attempt to bind to port 80, and will fail in that endeavor if IIS is listening on its default port.

Resolution:

Add the attribute highlighted in red to the configuration file specifying the callback port to avoid the obvious invasion and clash around port 80:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <client>
      <endpoint
          name="WSDualHttpBinding_ICalculationRequest"
          address="
http://localhost/CalculationService/CalculationService.svc"
          bindingConfiguration="WSDualHttpBinding_ICalculationRequest"
          binding="wsDualHttpBinding" contract="ICalculationRequest" />
    </client>
    <bindings>
      <wsDualHttpBinding>
        <binding name="WSDualHttpBinding_ICalculationRequest"
                 clientBaseAddress="
http://localhost:8099/CalculationClient/">
        </binding>
      </wsDualHttpBinding>
    </bindings>
  </system.serviceModel>
</configuration>

Unresolved to date:

While it is "expected" ...

  1. Why did it work in BETA-1? What has changed under the bonnet?
  2. Why did it work on Windows 2003, same code, same configuration ... breaking only on XP?
Posted by willy with no comments
Filed under:

Merry Christmas and a happy new year!

I would like to take this opportunity to wish all of you a Merry Christmas and a happy and successful 2006!
 
Hope that all of us will continue supporting the communities and that we will be able to take www.saArchitect.net to the next level in 2006 ... a huge thank you to everyone supporting our communities . Our focus will be intensified for CSF, WCF and software factories. Indigo rocks!
Posted by willy with no comments
Filed under:

WCF/Indigo … surviving the port warp from BETA-1 … log #5: QFE

For those, like I, who have battled to find the COM+ QFE, which adds support for the WS-AtomicTransaction protocol to MSDTC and support for the “Indigo” COM+ Integration feature can find it on http://go.microsoft.com/fwlink/?linkid=46976.

Craig, thanks for the treasure map!

Posted by willy with no comments
Filed under:

Beware of System.Timers in System Services

If you have are are going to write a system service in .NET and drop the Timer control onto the design page ... you should be warned that you may be opening a can of worms that may take hours to trace if you are as unlucky as we were. I have not fully tested all scenarios, however, we have found the timer to start lagging quite badly (from seconds to minutes) or disappear all-together when running multiple threads (especially those that are shaking hands with asynchronous IO).

According to http://support.microsoft.com/default.aspx?scid=kb;en-us;842793 the garbage collector "conveniently" collects the timer object if you happen to call Stop(), do processing and experience a GC visit before calling Start() again ... never ever to receive another timer event. Probably recorded as a 'feature'.

We have changed all System.Timer usage to System.Threading.Timer and are no longer experiencing any timer related issues. The Timer.Sleep function does not exhibit the lag or disappearance bevhaviour either, which probably means that it to is based on System.Timer.

When I have all the facts, I will revise this post ... until then, treat System.Timer usage with respect.

Posted by willy with 1 comment(s)
Filed under: , ,

Microsoft Technology Center - Week 3 Day 2

After another long day at MTC … we managed complete testing and to crawl back o hotel at 4am … we are bracing ourselves for more scalability testing. We posted more pictures on http://dotnet.org.za/photos/willy/category1290.aspx to give everyone an idea what Microsoft UK and the MTC are like. We are hoping that we will be able to share some of the findings with the community when we return, because we have uncovered some really invaluable nuggets of information.

 

What we can say is that (1) SQL Server 2005 rocks, (2) SQL Server 2005 64-Bit rocks even more and (3) .NET is up to the challenge of enterprise performance requirements. It is truly amazing what can be achieved with whiteboard "think-time", simplicity in terms of design and "tweaking" the right bits. In parallel we have “Weasel Wacking” (Mike Parkes’ terminology) for determining and resolving bottlenecks.

 

We have “4 more sleeps” as my boys would say before the first wave starts flying back to SA, with the rest following a day later.

Posted by willy with no comments
Filed under:

WCF/Indigo … surviving the port warp from BETA-1 … log #3: Config File Structure

Having a picture and whiteboard based mind it was important to plot the new configuration file structure in Visio.

Refer to http://www.drp.co.za/default.asp?id=technologies/content_technologies_UnderReview for a new DRAFT poster "Microsoft Indigo Configuratio", file "0206 Microsoft Indigo Configuration LowRes.jpg" under review, which attempts to simplify the perceived complexity of the WCF configuration file sections.

Posted by willy with no comments

Microsoft Technology Center - Week 3

Week 3 started with an explosive prelude, when the Buncefield Fuel Complex literally went up in smoke. After an Indigo/WCF all-nighter on Saturday night and finally crawling into bed at 5am, I was rudely woken up by a “thump” just after 6am … seeing the plume of black smoke rising over the UK makes one wonder what Greenpeace is discussing in their war rooms at the moment, because the UK must be accumulating CO2 emission for the next two gazillion centuries.

 

The testing of the scalability solution is continuing, whereby our last test on Friday was just as explosive … we literally lost 4x Quad Processor Servers, due to a seemingly insignificant memory leak, which nuked the servers. After a hectic Monday, we are once again ready for some serious testing, whereby the automated test framework I am responsible for is humming along on 30 test workstations, some of which are quad processor servers as well q;-)

 

In short, we are having fun, are learning a lot … even if the small room accommodating 11 people is at time a bit too hectic for my liking. “What is happening?”, “Are we testing?”, “What has changed?” are short questions which can drive anyone insane when busy with code analysis, log analysis or even worse, debugging a code change.

 

Posted by willy with no comments

WCF/Indigo … surviving the port warp from BETA-1 … log #2: Code breaking changes

Indigo's log CTP-Nov-#2  … we have identified the following changes in the predefined bindings when moving from BETA-1 to November CTP and with all likelihood BETA-2.

 

This log is a result of 18 hours, most spend last night, of code porting and battling with especially the configuration settings and X509 certificates. The latter is still incomplete and will be covered in one of the next log, because we have not yet figured out how to implement X509 message security between a WCF web service and another WCF system service … how do you give the Network User (default of Web Service) the rights to access the X509 certificates? Or alternatively how does one run the WCF Web Service using a trusted service account … interesting topics, but delegated to the future.

 

Tool Changes

  • ComSvcConfig.exe … the COM+ Service Model Configuration command-line tool has changed primarily in terms of the arguments. Best to run it with a /? Before using it again.
  • SvcConfigEditor … has not changed much, but pollutes your configuration file with attributes very quickly. While it is an excellent tool once your solution is humming or to locate configuration settings, it is a challenge when trying to figure out what is what in the configuration file.
  • SvcTraceViewer … wow, this tool has grown. We have noit yet been able to make it show anything in its message tab, however, the graphing capability is immensely valuable.

 

Where have all the Generics gone?

The usage of generics has been reduced in the latest CTP and the fundamental code:

using (ServiceHost<LogService> serviceHost =

   new ServiceHost<LogService>(new Uri(baseAddress))) {…}

… becomes

using (ServiceHost serviceHost = new ServiceHost(typeof(LogService),baseAddress)) {…}

 

Fault becomes FaultException

When used to using Fault<T> … port to FaultException<T>

When used to using UnknownFault … port to UnkownFaultException

 

Attribute Changes … a major facelift

[InstanceMode=…] is now [InstanceContextMode=…]

InstanceMode.Singleton      >> InstanceContextMode.Single

            .PrivateSession >>                    .PerSession

            .PerCall        >>                    .PerCall

            .SharedSession  >>                    .Shared

 

[BindingRequirements(….)] port to [TransactionFlow(…)]

RequirementsMode.Require >> TransactionFlowOption.Required

 

QueuedDeliveryRequirements=RequirementsMode.Require

… port to …

QueuedDeliveryRequirements=BindingRequirementsMode.Required

 

Configuration Files

Probably the area of most frustration, because most attributes and structures have changed. As the SvcConfigEditor tool refuses to open an old-style configuration file we resorted to rebuilding our configuration files using the svcutil tool and digging through the CTP documentation.

 

Sample Code

If you, like us, battle to find the mountain range of WCF samples the locate the following file and unzip during your next lunch break:

…\program files\Microsoft SDKs\Windows\v1.0\Samples\AllSamples.zip

 

WCF Documentation

Look in the Microsoft SDK program group, which contains an up to date and fairly comprehensive documentation.

 

Programming “Indigo Book” & Ascend BETA-1 Documentation

Useful reference material, however, both are outdated with the latest code breaking changes included in the latest CTP. Use the content with caution.

 

X509 Certificates

To be posted in due course …

 

Closing thought … while the migration is not seamless it is important to remember that we are working with a BETA-1 product! Looking at the latest CTP the excitement is rising in terms of what this technology can do for us in 2006 and beyond.

Posted by willy with no comments

WCF/Indigo … surviving the port warp from BETA-1 … log #1: Bindings

Indigo's log CTP-Nov-#1   we have identified the following changes in the predefined bindings when moving from BETA-1 to November CTP and with all likelihood BETA-2.

BETA-1

BETA-2

Interoperability

Security Default

Session

Transactions

Duplex

Streaming

Binding

Configuration Element

Binding

Configuration Element

BasicProfileBinding
<basicProfileBinding>

BasicHttpBinding
<basicHttpBinding>

Basic Profile 1.1

None

No

n/a

n/a

One-way only

WsProfileBinding
<wsProfileBinding>

WSHttpBinding
<wsHttpBinding>

WS

Message

Optional

Yes

n/a

n/a

WsProfileDualHttpBinding
<wsProfileDualHttpBinding>

WSDualHttpBinding
<wsDualHttpBinding>

WS

Message

Yes

Yes

Yes

n/a

NetProfileTcpBinding
<netProfileTcpBinding>

NetTcpBinding
<netTcpBinding>

.NET

Transport

Optional

Yes

Yes

One-way only

NetProfileDualTcpBinding
<netProfileDualTcpBinding>

N/A

.NET

SOAP

No

Yes

Yes

No

NetProfileNamedPipeBinding
<netProfileNamedPipeBinding>

NetNamedPipeBinding
<netNamedPipeBinding>

.NET

Transport

Yes

Yes

Yes

One-way only

MsmqIntegrationBinding
<msmqIntegrationBinding>

NetMsmqBinding
<netMsmqBinding>

MSMQ

Transport

No

Yes

No

No

NetProfileMsmqBinding
<netProfileMsmqBinding>

MsmqIntegrationBinding
<msmqIntegrationBinding>

.NET

Transport

Yes

Yes

No

No

 

Posted by willy with no comments

WCF/Indigo … surviving the port warp from BETA-1 … log #0: Introduction

Indigo's log CTP-Nov-#0 … we have started the challenging migration of our Indigo-based, now WCF-based, solution. Originally developed using BETA-1 and pre-BETA CTPs, we have realized that the port from BETA-1 to the latest CTP (November) is a real challenge.

 

Ports from post-BETA-1 CTPs to November CTP are likely to be less bumpy flights.

 

We will post our findings over the next few days as we plod through the solution and get bits by bits operational again. If you have any additional findings, please let us know, so that we can feed to the WCF/Indigo community in Southern Africa.

Posted by willy with no comments

Microsoft Technology Center - Week 2

We are in week two of the MTC (Microsoft Technology Centre) and have made amazing progress with our scalability project ... throughputs have been increased by a factor of 13.32353, with a lot of scope for improvement left. The ‘gurus’ assisting us have taught us a lot and the collection of utilities they pull out of their toolkit is both scary and amazing.

 

What I pondered over while taking a stroll along the Thames yesterday, however, is whether the concept of sending a team of developers to a remote destination with a project plan crumpled into a laptop bag is actually a good idea. What started as a 3 week engagement, planned with military style precision, has turned into a project manager’s challenge.

 

Project management and testers want to complete all the agreed tests and do the “granny ticking” of each test completed. The developers, however, see issues and challenges all over the place, spawning the scope creep threads and triggering the code change avalanche … both of which are in clear conflict with the test schedule focused members.

 

Should one stick to the plan? Should one ditch the plan and focus on the issues and ideas uncovered? Should we be creating two streams, one testing and the other revolutionizing the solution?

 

The decision must be based on sponsor expectations and we will get that decision in due course. Personally I have not yet come to a conclusion, probably because I am a developer and analyst at heart, but on this engagement have clear testing deliverables. We will most likely converge on the same path during week 3 … so in the interim we will continue to learn and having lots fun with technology.

 

See category MTC in http://dotnet.org.za/photos/willy/default.aspx for some photos.

Posted by willy with no comments
Filed under:

saArchitect Event (Gauteng): Software Factories Session 2006-01-26

When:        January 26, 2006 18:00-20:00
Duration:    2 hours
Level:          200

Presenters: 
By Simon, Willy and Ernst
Where:        Microsoft SA (Johannesburg) see http://www.microsoft.com/southafrica/corp/contact.mspx for details and a map.
Contact:      maria@bbd.co.za for further information on event or venue.
Handouts:   CD with copy of presentations, posters and samples.

A software factory is a durable starting point that configures Visual Studio for rapid development of a target application type. Software Factories refers to a Microsoft initiative that provides contextual guidance and automation for developing software using Visual Studio. This session takes a look at what software factories, domain specific languages and guidance automation tools are and "how to" develop with them.

Please register by replying to this post, leaving your details and relevant comments. If you do register, please ensure that you make every effort to appear for the event, because the sponsors and presenters are investing immense effort in preparing for and hosting these saArchitect sessions.

Posted by willy with 11 comment(s)
Filed under: ,

saArchitect Event (Gauteng): Windows Communication Foundation (Indigo) Session 2006-02-23

When:         23 February 18:00-20:00
Duration:     2.0 hours (45 min overview, 15min break and 45-60min demo)
Level:          Part 1: 200, Part 2: 300

Presenters:  Willy Schaub, Garret Besser

Where:        SysPro (Johannesburg) see http://www.syspro.co.za/wrldwd.aspx#SouthAfrica for details and a map.
Contact:      maria@bbd.co.za for further information on event or venue.
Handouts:   CD containing presentation, posters, companion code and whitepapers.
Prizes:        Memory sticks, Books, ...

Part 1: What is Windows Communication Foundation (WCF) alias Indigo

A Sneak Peek at WCF - The Unified Framework for Building Connected Systems. WCF is Microsoft's unified framework for building service-oriented applications. It enables developers to build secure, reliable, transacted solutions that interoperate across platforms and integrate with existing investments. Indigo combines and extends the capabilities of existing distributed systems technologies, including Enterprise Services, System Messaging, .NET Remoting, ASMX, and WSE to deliver a unified development experience spanning distance, topologies, hosting models, protocols, and security models. This session will provide an overview of Indigo and show you how WCF will simplify the development of connected systems.

Part 2: Windows Communication Foundation (WCF) alias Indigo Drill-down: Developing Services

A Sneak Peek at WCF service development. This session will provide an overview of how to program Indigo and include after-session mentorship to ensure that attendees can explore the technology and build code after the session. All code samples will be based on the "how to Indigo " section in the new .NET Enterprise Solutions ... Interoperability for the Connoisseur book and WCF lab samples.

Part 3: Migration from WCF Beta-1

Discussion on migration issues from BETA-1 to current CTPs.

Please register by replying to this post, leaving your details and relevant comments. If you do register, please ensure that you make every effort to appear for the event, because the sponsors and presenters are investing immense effort in preparing for and hosting these saArchitect sessions

Posted by willy with 1 comment(s)

Visual Studio 2005 Team System TechNotes (link)

Visual Studio 2005 Team System TechNotes (http://msdn.microsoft.com/vstudio/teamsystem/reference/technotes/)

Microsoft is happy to announce a new area on the MSDN site devoted to technical notes on Visual Studio Team System. TechNotes are a new and exciting channel for publishing technical information to the customers and join existing resources such as On-Demand Webcasts, Technical White papers, Virtual Labs, FAQs, Forums, and Blogs. These technical notes, roughly 800-1500 words in length, cover a very specific technical topic about VSTS. Unlike blog postings, TechNotes have the advantage of being centrally archived and are perceived by customers as being more authoritative.

We encourage you to take a look at the TechNotes that we have today and be aware of this new resource.Check out a sampling of our new TechNotes:

§        TN_1100: Understanding Applications and the Application Diagram

§        TN_1101: Understanding and Using the Default System

§        TN_1105: Why Class Libraries are not shown on an Application Diagram

§        TN_1203: Code Coverage basics from the IDE

§        TN_1204: Profiling ASP.NET from the command line in sampling mode

§        TN_1600: Building ASP.NET projects with Team Build

§        TN_1601: Team Build and Web Deployment Projects

§        TN_1700: Which Team Foundation commands need to be checked in?

§        TN_1701: How do Team Foundation Source Control locks and permissions differ?

Posted by willy with no comments
Filed under: