December 2006 - Posts

DRP Technology Readiness News Snippet - December 2006 Summary

 
Sessions covered this month
  • We have completed overview sessions on Windows Workflow (WF), Windows Communication Foundation (WCF) and Reporting services (Friday), as well as a WF drilldown and a WCF demonstration during December. Both the Windows Workflow and Windows Communication Foundation technologies have been identified as new and strategic technologies and we are hoping that the demand for drill-down sessions will allow us to jointly explore the technology and build the communities experience and competence with the technologies.

Sessions scheduled for January 2007

New Posters
The following quick reference posters were released during December on http://www.drp.co.za/Media/Posters/tabid/73/Default.aspx for all users and \\ether\dfspublic\cassini\2006 Core DRP\DRP Material\Quick Reference Posters for BB&D intranet users. The WF posters will be uploaded during the course of today.
  • 0202 Microsoft Team System Project Build
  • 0206 Microsoft Indigo Attributes Poster
  • 0400 WF Posters - Batching
  • 0402 WF Posters - Compensation
  • 0404 WF Posters - Correlated Local Service
  • 0406 WF Posters - Local Services
  • 0408 WF Posters - Queues
  • 0410 WF Posters - Roles
  • 0412 WF Posters - SqlWorkflowPersistence
  • 0414 WF Posters - Tracking
  • 0416 WF Posters - WebService
  • 0418 WF Posters - WorkflowChanges

What are the objectives of this technology readiness sessions? 
  • Introduce current, new and bleeding edge technology to the project teams, empowering them to  select the right technology for the correct project.
  • The sessions do not present sanctioned technology or architectures.
  • The technology readiness overview sessions are, as the name implies, "overview" sessions. If your team is considering any current, new or bleeding edge technology, please check if a drill-down or boot camp program exists for the technology, to ensure your team can obtain a rapid ramp-up when and as needed, to ensure you can and will use the technology effectively from the start.
  • Statistics: Out of the listed technology readiness sessions 0% are bleeding edge and only 10% are based on new technology. The remainder are based on BB&D and/or industry proven technology.

Winner of the dinner voucher
  • The December winner of the dinner is Willem Pienaar. Congratulations! We will be in touch with you shortly in terms of the voucher.
  • Remember that we are drawing one of the session review forms every month for the lucky dinner voucher prize!

Other interesting information

To end this technology readiness news snippet, the BB&D Microsoft Technology Unit (MTU) would like to take the opportunity to wish everyone a Merry Christmas, a save hop into the new year and all of the very best for 2007!
Subscribe to http://www.dotnet.org.za/willy and http://www.drp.co.za/Blogs/tabid/60/BlogID/13/Default.aspx for interesting news on Microsoft technology and the Technology Readiness program.
Posted by willy with no comments

Visual Studio 2005 - Service Pack 1

We have successfully tested the Visual Studio Service Pack 1 on Partner Premium and Team Suite Edition, both with and without .NET3 runtime and SDK.

 

VSTS team … you have done a great job and deserve a pat on their backs for completing the service pack before the festive season.

 

… next step will be to upgrade out Team Foundation Servers to SP1, which we will most likely do during next week’s quiet December … we hope … time. Will keep you posted on issues, if any.

Posted by willy with no comments
Filed under: , ,

WCF Debugging - IIS hosted services

The only way we have been able to debug WCF services hosted in IIS, is by attaching the debugger to the aspnet_wp.exe process manually and then setting breakpoints or stepping into service methods.


Other options are to create an ordinary ASP.NET project and implementing the WCF service there, to create a console application that will host the WCF services, or inserting a call to Debugger.Lauch() into the service method to launch the debugger window.

 

The simplest and recommended debugging strategy is to host your WCF service in a console application, debug the service using the console application and migrating to the IIS host once debugged.

Posted by willy with 2 comment(s)

WCF FaultException … why use it?

Exceptions are technology specific and therefore not suitable to cross the service boundary of SOA compliant services. Another anomaly we identified is that all exceptions, with the exception of FaultException fault the communication channel, resulting in unhappy proxies as a recover and retry is not possible.

What we need are soap faults that are an industry standard for seamless interoperability … WCF, and there is more … delivers the answer to Soap Faults as FaultException, which result in a soap fault and do not fault the communication channel.

The operations which may throw a FaultException, must be decorated with one or more FaultContract attributes, defining the “exact” FaultException:

[OperationContract]

[FaultContract(typeof(DivideByZeroException))]

void FaultDemoFaultSimple();

The service consumer should catch specific FaultExceptions as shown below, prior to the FaultException and CommunicationException types, to be in a position to handle the specified exceptions:

try

{

    proxy.FaultDemoFaultSimple();

}

catch ( FaultException<DivideByZeroException> ex)

{

    Debug.WriteLine("FE<>: " + ex.ToString());

}
catch ( FaultException ex )

{

    Debug.WriteLine("Fault: " + ex.ToString());

}

To test the FaultException concept we defined the following interface:

[ServiceContract()]

public interface IFaultDemoService

{

    [OperationContract]

    [FaultContract(typeof(DivideByZeroException))]

    void FaultDemoFaultSimple();

 

    [OperationContract]

    [FaultContract(typeof(DivideByZeroException))]

    void FaultDemoFaultException();

 

    [OperationContract]

    [FaultContract(typeof(DivideByZeroException))]

    void FaultDemoFaultExceptionCodeReason();

 

    [OperationContract]

    [FaultContract(typeof(DivideByZeroException))]

    void FaultDemoFaultExceptionReason();

 

    [OperationContract]

    [FaultContract(typeof(DivideByZeroException))]

    void FaultDemoFaultExceptionVerbose();

 

    [OperationContract]

    [FaultContract(typeof(DivideByZeroException))]

    void FaultDemoException();

}

The service implementation is as follows:

public class FaultDemoService : IFaultDemoService

{

    #region IFaultDemoService Members

 

    public void FaultDemoFaultSimple()

    {

        try

        {

            int i, j = 0;

            i = 1 / j;

        }

        catch

            throw new FaultException("FaultDemoFaultSimple()",

                                     new FaultCode("FDFS Fault Code"),

                                     "FDFS Action");

    }

 

    public void FaultDemoFaultException()

    {

        try

        {

            int i, j = 0;

            i = 1 / j;

        }

        catch ( DivideByZeroException ex )

            throw new FaultException<DivideByZeroException>(ex);

    }

 

    public void FaultDemoFaultExceptionReason()

    {

        try

        {

            int i, j = 0;

            i = 1 / j;

        }

        catch (DivideByZeroException ex)

            throw new FaultException<DivideByZeroException>

                                    (ex,"FDFER Reason");

    }

 

    public void FaultDemoFaultExceptionCodeReason()

    {

        try

        {

            int i, j = 0;

            i = 1 / j;

        }

        catch (DivideByZeroException ex)

            throw new FaultException<DivideByZeroException>

                    (ex, "FDFER Reason", new FaultCode("FDFER Code"));

    }

 

    public void FaultDemoFaultExceptionVerbose()

    {

        try

        {

            int i, j = 0;

            i = 1 / j;

        }

        catch (DivideByZeroException ex)

            throw new FaultException<DivideByZeroException>

                    (ex, "FDFER Reason", new FaultCode("FDFER Code"));

    }

 

    public void FaultDemoException()

    {

        int i, j = 0;

        i = 1 / j;

    }

 

    #endregion

}

The test client is coded as:

static void Main(string[] args)

{

    service.FaultDemoServiceClient proxy =

               new FaultDemoProgram.service.FaultDemoServiceClient();

 

    Debug.WriteLine(">");

    Debug.WriteLine("FaultDemoFaultSimple -------------------------");

    Debug.WriteLine("1a... Channel: " +

                    proxy.InnerChannel.State.ToString());

    try { proxy.FaultDemoFaultSimple(); }

    catch (FaultException<DivideByZeroException> ex)

        Debug.WriteLine("FE<>: " + ex.ToString());

    catch (Exception ex)

        Debug.WriteLine(ex.ToString());

    Debug.WriteLine("1b... Channel: " +

                    proxy.InnerChannel.State.ToString());

 

    Debug.WriteLine(">");

    Debug.WriteLine("FaultDemoFaultException -----------------------");

    Debug.WriteLine("2a... Channel: " +

                    proxy.InnerChannel.State.ToString());

    try { proxy.FaultDemoFaultException(); }

    catch (FaultException<DivideByZeroException> ex)

        Debug.WriteLine("FE<>: " + ex.ToString());

    catch (Exception ex)

        Debug.WriteLine(ex.ToString());

    Debug.WriteLine("2b... Channel: " +

                    proxy.InnerChannel.State.ToString());

 

    Debug.WriteLine(">");

    Debug.WriteLine("FaultDemoFaultExceptionReason ----------------");

    Debug.WriteLine("3a... Channel: " +

                    proxy.InnerChannel.State.ToString());

    try { proxy.FaultDemoFaultExceptionReason(); }

    catch (FaultException<DivideByZeroException> ex)

        Debug.WriteLine("FE<>: " + ex.ToString());

    catch (Exception ex)

        Debug.WriteLine(ex.ToString());

    Debug.WriteLine("3b... Channel: " +

                    proxy.InnerChannel.State.ToString());

 

    Debug.WriteLine(">");

    Debug.WriteLine("FaultDemoFaultExceptionCodeReason ------------");

    Debug.WriteLine("4a... Channel: " +

                    proxy.InnerChannel.State.ToString());

    try { proxy.FaultDemoFaultExceptionCodeReason(); }

    catch (FaultException<DivideByZeroException> ex)

        Debug.WriteLine("FE<>: " + ex.ToString());

    catch (Exception ex)

        Debug.WriteLine(ex.ToString());

    Debug.WriteLine("4b... Channel: " +

                    proxy.InnerChannel.State.ToString());

 

    Debug.WriteLine(">");

    Debug.WriteLine("FaultDemoFaultExceptionVerbose ---------------");

    Debug.WriteLine("4a... Channel: " +

                    proxy.InnerChannel.State.ToString());

    try { proxy.FaultDemoFaultExceptionVerbose(); }

    catch (FaultException<DivideByZeroException> ex)

        Debug.WriteLine("FE<>: " + ex.ToString());

    catch (Exception ex)

        Debug.WriteLine(ex.ToString());

    Debug.WriteLine("4b... Channel: " +

                    proxy.InnerChannel.State.ToString());

 

    Debug.WriteLine(">");

    Debug.WriteLine("FaultDemoException ---------------------------");

    Debug.WriteLine("5a... Channel: " +

                    proxy.InnerChannel.State.ToString());

    try { proxy.FaultDemoException(); }

    catch (FaultException<DivideByZeroException> ex)

        Debug.WriteLine("FE<>: " + ex.ToString());

    catch (Exception ex)

        Debug.WriteLine(ex.ToString());

    Debug.WriteLine("5b... Channel: " +

                    proxy.InnerChannel.State.ToString());

    Console.ReadLine();

}

So what will the resultant output be you may ask … well here we go, whereby we added some inline comments demarcated in []’s:

1b... Channel: Opened

FaultDemoFaultException ----------------------------------------

2a... Channel: Opened

A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in mscorlib.dll

[NOTE that we caught the specific DivideByZero FaultException]

FE<>: System.ServiceModel.FaultException`1[System.DivideByZeroException]: The creator of this fault did not specify a Reason. (Fault Detail is equal to System.DivideByZeroException: Attempted to divide by zero.

   at FaultDemoService.FaultDemoFaultException() in c:\Working\FaultDemo\FaultDemoService\App_Code\Service.cs:line 58).

2b... Channel: Opened

[NOTE that the channel is still open after the fault was caught]

FaultDemoFaultExceptionReason ----------------------------------------

3a... Channel: Opened

A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in mscorlib.dll

FE<>: System.ServiceModel.FaultException`1[System.DivideByZeroException]: FDFER Reason (Fault Detail is equal to System.DivideByZeroException: Attempted to divide by zero.

   at FaultDemoService.FaultDemoFaultExceptionReason() in c:\Working\FaultDemo\FaultDemoService\App_Code\Service.cs:line 71).

3b... Channel: Opened

FaultDemoFaultExceptionCodeReason ----------------------------------------

4a... Channel: Opened

A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in mscorlib.dll

FE<>: System.ServiceModel.FaultException`1[System.DivideByZeroException]: FDFER Reason (Fault Detail is equal to System.DivideByZeroException: Attempted to divide by zero.

   at FaultDemoService.FaultDemoFaultExceptionCodeReason() in c:\Working\FaultDemo\FaultDemoService\App_Code\Service.cs:line 84).

4b... Channel: Opened

FaultDemoFaultExceptionVerbose ----------------------------------------

4a... Channel: Opened

A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in mscorlib.dll

FE<>: System.ServiceModel.FaultException`1[System.DivideByZeroException]: FDFER Reason (Fault Detail is equal to System.DivideByZeroException: Attempted to divide by zero.

   at FaultDemoService.FaultDemoFaultExceptionVerbose() in c:\Working\FaultDemo\FaultDemoService\App_Code\Service.cs:line 97).

4b... Channel: Opened

FaultDemoException ----------------------------------------

5a... Channel: Opened

[NOTE that the channel is still open before the exception was caught]

A first chance exception of type 'System.ServiceModel.FaultException' occurred in mscorlib.dll

System.ServiceModel.FaultException: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

Server stack trace:

   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)

   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)

   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

 

Exception rethrown at [0]:

   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

   at FaultDemoProgram.service.IFaultDemoService.FaultDemoException()

   at FaultDemoProgram.service.FaultDemoServiceClient.FaultDemoException() in C:\Working\FaultDemo\FaultDemoProgram\Service References\service.cs:line 112

   at FaultDemoProgram.Program.Main(String[] args) in C:\Working\FaultDemo\FaultDemoProgram\Program.cs:line 88

5b... Channel: Faulted

[NOTE that the channel is faulted after the exception was caught. It proves that throwing a .NET exception is fatal to the channel, whereas a FaultException is handled gracefully.]

 

Hope this snippet of the DRP2007 is of value to you when dealing with the impossible, the unthinkable … the exception.

 

 

Posted by willy with 5 comment(s)

Team Foundation Server Service Pack 1 "Ships"

Finally the long awaited TFS service pack 1 has shipped ... see http://www.microsoft.com/downloads/details.aspx?FamilyID=A9AB638C-04D2-4AEE-8AE8-9F00DD454AB8&displaylang=en for Team Suite SP1, and http://www.microsoft.com/downloads/details.aspx?FamilyID=A9AB638C-04D2-4AEE-8AE8-9F00DD454AB8&displaylang=en for TFS SP1. Also refer to http://blogs.msdn.com/heaths/archive/2006/12/16/slipstreaming-visual-studio-2005-service-pack-1.aspx for a slip streamed view of the installation by Heath Stewart ... excellent post if you are on the verge of upgrading your TFS environments.
Posted by willy with 1 comment(s)
Filed under: ,

Technology Readiness Sessions - Commencing with WF and WCF against all odds

The technology readiness events as per http://www.drp.co.za/Events/TechReady/tabid/74/Default.aspx have commenced, whereby we have completed WF Overview and a WF Drill-Down session this week, with WCF Overview and another WF Overview briefing concluding the hectic week tomorrow. We hope to see even more enthusiastic technologists next year!

 

To date I have enjoyed the program, although my laptop blew its fan and I am currently running it on top of an air-conditioner, which is not very ergonomic … but keeps the processor running at full speed. It does prove, however, that we always make a plan to conclude any battle and that the gadgets we gather are actually useful as shown in http://dotnet.org.za/photos/willy/picture86035.aspx.


OK, I must shutdown now, because my ice tea tin is warm, processor is slowing down and the keyboard is a touch too warm.

Posted by willy with no comments

Working out the Team Foundation Server Team project limits

http://msdn2.microsoft.com/en-us/library/aa974183(vs.80).aspx is an excellent whitepaper, by Bill Essary, and includes a niffty spreadsheet, allowing you to experiment and plan team project limits and the factors that influence team project limits. It is a "must read" for those involved in TFS planning. 
Posted by willy with no comments
Filed under:

Test Manager Add-In for Visual Studio Team Edition for Software Developers

A long awaited feature for those using Team Edition for Developers and wanting to manage test lists ... 

 Ekobit (www.ekobit.com) released “Test Manager Add-In for Visual Studio Team Edition for Software Developers”, which introduces an add-in that makes it possible for developers to manage the lists of tests, build hierarchies and execute tests from the Team Edition for Software Developers just the way they would be able to do using the Test Manager window if they had Team Suite.

Refer to http://www.ekobit.com/testmngr.aspx for more detail.

Posted by willy with no comments
Filed under: ,

Visual Studio Team Edition for Database Professionals (Datadude) has gone RTM

Visual Studio Team Edition for Database Professionals (Datadude) has gone RTM and is available on MSDN Subscriber Downloads (http://msdn2.microsoft.com/en-us/default.aspx).

Do not install the 3.8GB DVD image if you are already a licensed Team Suite user, but instead download the Visual Studio Team Edition for Database Professionals - Trial Edition (English), which will detect that you have a full license and do its stuff.

We will be focusing on the Datadude on January 19th and 26th as part of our technology readiness program, see http://www.drp.co.za/Events/EventsList/tabid/53/ctl/Details/Mid/361/ItemID/17/Default.aspx?selecteddate=1/19/2007 for details.

Posted by willy with no comments
Filed under: , ,

New WCF Artefacts and Attributes Quick Reference Poster published

You can find the latest quick reference poster "0206 Microsoft Indigo Attributes Poster" at http://www.drp.co.za/Media/Posters/PostersPDF/tabid/62/Default.aspx. It shows the artefacts making up the eventual WSDL contract file and the numerous attributes. Note that the high quality poster (JPG) is best digested in A2 format, as the attribute documentation is quite challenging to read on A4.
Share this post: email it! | bookmark it! | digg it! | reddit! |