|
|
Browse by Tags
All Tags » WCF (RSS)
-
.NET Reflector, by Lutz Roeder, must be one of the most useful tools I have when developing .NET code. Usually it is the first thing I install right after Visual Studio not even waiting until I need it because I know I will. So the big news is that Red Gate, makers of the Ants profiler and lots of other tools, are taking over from Lutz Roeder and will continue developing .NET Reflector. Interesting move and I hope this means a bright future for the .NET Reflector. Read more about this here . Enjoy! www.TheProblemSolver.nl Wiki.WindowsWorkflowFoundation.eu Read More...
|
-
It is available from the subscriptions download at http://msdn.microsoft.com/en-us/subscriptions/default.aspx Get it while it is hot Enjoy! Read More...
|
-
In a previous blog post I write about what happens when you place a TransactionScopeActivity within a ReceiveActivity and an exception occurs that is supposed to roll back the transaction. In short the story was very bad and we could come up with only a partial workaround, not a pretty sight. But there is more to it than just that little horror story. Suppose you do the obvious and place the a TransactionScopeActivity within a ReceiveActivity and no exception occurs. Say like the workflow below, please note that the codeActivity1 only sets the return value and causes no error. Now the transaction is committed and the WCF call returns perfectly normally so everything is good right. Well not quite The obvious first point is that the TransactionScopeActivity serves no real purpose. After all if it isn't allowed to fail under any circumstances why bother with it in the first place. Well ok there is the point of doing several updates as a single transaction so other users cannot see a partially committed order but that is about it. But that is actually the least of my worries as there is a far bigger issue to worry about and that is called workflow persistence. Yes that is right. After all when we are using a TransactionScopeActivity workflow persistence is mandatory. The TransactionScopeActivity is decorated with the PersistOnClose attribute so the state of the workflow will be persisted as soon as the transaction is complete. And normally that is a good thing but in this case Read More...
|
-
I got an email from a friend last week asking about using a ReceiveActivity and, while receiving, using a TransactionScopeActivity to transitionally save some data in a database. Seems like a common enough scenario right? Well he was having some problems. If everything worked and the transaction succeeded everything was fine and the answer came back. But if an exception occurred and the transaction was aborted be was receiving a real weird error: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Workflow service unexpectedly unloaded from memory while executing a ReceiveActivity. Make sure that the the workflow does not contain any blocking activities within a ReceiveActivity. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.InvalidOperationException: Workflow service unexpectedly unloaded from memory while executing a ReceiveActivity. Make sure that the the workflow does not contain any blocking activities within a ReceiveActivity.). If we where to believe the message there was a blocking call, something there most certainly was not! And to make things more confusing, if we removed the TransactionScopeActivity and just let the exception occur it would bubble back to the client just as it was supposed to. So what gives? Well a lot of people looked at this and in the end we declared this a pretty bad bug. Mind you our words not those from Microsoft. But we did find a workaround. Read More...
|
-
Afgelopen jaar hebben we het eerste CodeCamp in Nederland georganiseerd en dat was een groot succes. De meeste deelnemers vroegen om meer, sommige zelfs om een CodeCamp per kwartaal of een heel weekend lang. Nou hebben we dat laatste nog niet gedaan maar we zijn wel aan de slag gegaan om een nieuw CodeCamp te organiseren. Als datum hebben we zaterdag 6 september gekozen. Gelukkig waren Microsoft en Class-a behulpzaam en kunnen we, net als vorig jaar, weer in het Microsoft Innovation Center in Barneveld terecht. Een mooie datum en locatie om uitgerust van de vakantie een hoop kennis uit te wisselen. Het programma staat nog niet helemaal vast, hou daar de website voor in de gaten, maar je kan er ondermeer de bekende Nederlandse sprekers verwachten. Uiteraard kan je zelf ook nog een sessie voorstellen dus als je een idee hebt voor een leuke sessie laat het dan zo snel mogelijk weten. Dus zet de datum vast in je agenda en meld je zo snel mogelijk aan op de website www.code-camp.nl . Het CodeCamp is een gezamenlijk initiatief van de SDN , de stichting DotNed en VB Central . Read More...
|
-
I did a webcast on using WCF from Silverlight 2.0 this morning - I think you can see the replay here in about 24-hours - http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032380766&EventCategory=5&culture=en-US&CountryCode=US If you watched (or watch the replay) here is the code: webcastcode.zip (3.46 MB) Check out my BizTalk R2 Training . Read More...
|
-
Glav posts about a problem I've also had recently - that Matt helped me figure out how to solve. The exception is (repeated here for seach purposes): This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name: item Description : An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name : item The way to solve this problem is to setup multiple web sites in IIS (rather than having one site that has multiple Host entries) - and point all the websites to the same directory. Hope this helps someone. Check out my BizTalk R2 Training . Read More...
|
-
VS2008 SP1 Beta is quite a package. By default the installation downloads the packages as needed and when needed. Now that is just fine if you only need to install a single machine. But when you need to install multiple, possibly virtual, machines like I have to it just wastes a lot of bandwidth and time . Fortunately there is a solution and it can be found here in the blog post by Heath Stewart. Enjoy! Read More...
|
-
Visual Studio visualizers are pretty cool and can help you quite a bit when debugging but you need to develop them and that just ads to the workload. So how about having someone else do it? Well Microsoft added a few visualizers to VS2008 and VS2008 but they are pretty much limited to text, html and XML data. Luckily some people liked the idea of using visualizers and actually decided to take it to the next level with project Mole . Its a really great viewer to inspect your data and the "Black Ops" feature that allows you to inspect all private members is awesome. One quick tip: If you want to use the Mole with any variable use the "new WeakReference(variable)" in the watch window trick! Enjoy! www.TheProblemSolver.nl http://wiki.WindowsWorkflowFoundation.eu Read More...
|
-
The new ReceiveActivity and SendActivity that marry Windows Workflow Foundation (WF) and Windows Communication Foundation (WCF) are really cool . Getting started is easy because a new Sequential Workflow Service Library, found under WCF instead of Workflow in VS2008, uses nice defaults for everything. But sooner or later you need to change these defaults and you need to know what can be done and what can't. When you want to use the new ReceiveActivity in a workflow you need to use a compatible WCF binding. The reason for this requirement is that the conversation context, see this blog post , is part of the message and needs to be retrieved and returned. The following code returns a list of all WCF binding and how they are composed: Sub Main() Dim assemblies As New List( Of Assembly)() ' .NET 3.0 assemblies.Add( GetType (ServiceHost).Assembly) ' .NET 3.5 assemblies.Add( GetType (WorkflowServiceHost).Assembly) assemblies.Add( GetType (WebServiceHost).Assembly) Dim query = From assembly In assemblies _ From type In assembly.GetTypes() _ Where type.IsSubclassOf( GetType (Binding)) _ AndAlso Not type.IsAbstract _ AndAlso type.IsPublic _ Order By type.Name _ Select type PrintBinding(query.ToList) Console.ReadLine() End Sub Private Sub PrintBinding( ByVal types As List( Of Type)) For Each type In types Console.WriteLine(type.FullName) Try Dim binding As Binding = _ CType (Activator.CreateInstance(type), Binding) Dim elements = binding.CreateBindingElements For Each element Read More...
|
-
In a previous blog post I showed how to use the ReceiveActivity with long running workflow and how to extract the workflow instanceId from the context using the IContextManager. I also showed how to rebuild this context at a later date when you use a new proxy object to call the same workflow instance. But what happens when there are multiple ReceiveActivity instances waiting for the same request in a workflow. In the workflow below both indicated activities are in a parallel activity so they are waiting at the same time and for the same request. The way to keep them apart is by specifying the ContextToken for the two ReceiveActivity objects. The picture below shows the ReceiveActivity to the right, the one to the left has a ContextToken named LeftBranch. Now we know how to keep them apart in the workflow we still need a way to specify this at the clients end. This is done using a conversationId setting on the same context as we specified the instanceId. The only problem here is that this conversationId is a Guid and not something the client can determine by itself so the workflow needs to supply it somehow. For this example I just kept things simple and returned the conversationId from the first ReceiveActivity call. This is the code in the CodeActivity that does just that: private void codeActivity1_ExecuteCode( object sender, EventArgs e) { IDictionary < string , string > context = RightReceiveActivity.Context; string temp; if (context.TryGetValue( "conversationId" Read More...
|
-
In my last post I showed how to self host the workflow runtime and still be able to use a Windows Communication Foundation and ReceiveActivity. Hosting the workflow runtime in a WorkflowServiceHost is nice but in all likelihood you will also need to configure the workflow runtime itself and add some WorkflowRuntimeService to it. So how to do this when you never actually create the workflow runtime yourself? There are two possible ways to go about this depending if you prefer to use code or a configuration file. Lets first look at the code option as it is easier to see all the working parts. In the case of a WCF hosted workflow runtime the WorkflowRuntimeBehavior is the WCF ServiceBehavior that is actually responsible for creating the WorkflowRuntime. Fortunately getting a reference to it, and thereby the WorkflowRuntime, isn't hard. // Create the host WorkflowServiceHost host = new WorkflowServiceHost ( typeof ( Workflow1 )); // Retreive the WF behavior WorkflowRuntimeBehavior workflowRuntimeBehaviour = host.Description.Behaviors.Find< WorkflowRuntimeBehavior >(); // Retreive the WF runtime WorkflowRuntime workflowRuntime = workflowRuntimeBehaviour.WorkflowRuntime; // Create and add the SqlWorkflowPersistenceService SqlWorkflowPersistenceService persistenceService = new SqlWorkflowPersistenceService (connectionString); workflowRuntime.AddService(persistenceService); // Start listening host.Open(); Doing the same in a configuration file isn't hard either. The main Read More...
|
-
One of the new, and pretty cool, Windows Workflow Foundation features is the ReceiveActivity that unleashes the power of Windows Communication Foundation to Windows Workflow Foundation. Getting started with a ReceiveActivity is quite simple as long as you start with a sequential Workflow Service Library. The new service host for Windows Communication Foundation services makes life good as it means you can test a workflow without creating a host application or resorting to IIS. But sometimes you just want to host the workflow runtime yourself and still use the ReceiveActivity. So how to go about and do that? For a normal WCF host you would use an instance of ServiceHost but with a ReceiveActivity that isn't quite going to cut it as the host needs some awareness of WF and ServiceHost is very generic. So instead add a reference to System.WorkflowServices and create an instance of WorkflowServiceHost. The syntax is the same so no surprises there: WorkflowServiceHost host = new WorkflowServiceHost ( typeof ( Workflow1 )); host.Open(); Console .WriteLine( "Press enter to stop." ); Console .ReadLine(); The app.config contains the runtime configuration but all of it is pretty standard WCF stuff so no surprises: <? xml version = " 1.0 " encoding = " utf-8 " ?> < configuration > < system.serviceModel > < services > < service name = " WorkflowConsoleApplication1.Workflow2 " behaviorConfiguration = " WorkflowConsoleApplication1.Workflow2Behavior Read More...
|
-
Next march 28 we are hosting another SDE event in Ede, the Netherlands. There is an impressive list of speakers and sessions, check it out here . I will be doing a session about the new Workflow Foundation features in the .NET framework 3.5. These new features, also known as Silver, enable workflows to work together with Windows Communication Foundation (WCF) in a real nice and intuitive manner And just to get a taste here is a screen cast made during the last SDE held in December. The screen cast is in Dutch and for SDN members only! Enjoy Read More...
|
-
Looking for more information about VS2008 and .NET 3.5? I suspect you might just be as there is a ton of new functionality and with the pace of everything coming out it isn't likely that you know it all To help learn the new stuff Microsoft has put a Visual Studio 2008 and .NET Framework 3.5 training kit together with lots of labs and presentations. Just go through the list and check what you would like to know more about. You can download the trainings kit from here . Enjoy! Read More...
|
|
|
|