Preparing for VSLive Orlando 2011

I have the priviledge to speak at VSLive this year in Orlando. Here are the outlines for my two sessions...

T3 AppFabric, Workflow and WCF - The Next Generation Middleware

Imagine a future where you can write a composite (N-Tier) app and quickly deploy it to a server, public or private cloud.

Where the platform supports elastic scale, stateless and partitioned stateful services. In this session you will learn how you can take advantage of this powerful new platform.

You will learn:

  • What AppFabric is and where it is going in the future
  • How you can create services and workflows using this new platform
  • How to publish, manage and monitor apps using AppFabric

T8 Building Applications with Windows Workflow Foundation and Windows Azure

Windows Workflow Foundation shipped with .NET 4 and is a great way to build extensible apps, model long-running processes and orchestrate services. In this session, we’ll look at the options available to leverage Workflow Foundation in Windows Azure, starting with the capabilities on offer today, before taking a peek into the future and looking at some new features that the team is working on for running and managing workflows in Azure.

Currently rated 2.0 by 4 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 11/21/2011 at 1:27 AM
Categories: WCF | WCF | WF | WF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

WF/WCF CorrelationHandle with Entities

I recently was helping someone out who was having trouble with setting correlation for workflow instances. He wanted to pass in an entity as a property to a service call correlating with other service calls. This can simply be done by setting up the correlation based on a unique value of the property. For instance, if  Candidate.CandidateId is unique and you need to pass in the entire Candidate object, you can set the "CorrelatesOn" property, "Query" to just the CandidateId of the object being passed in.  You will also see a "Key" property within the "CorrelatesOn", this property needs to match the other correlated set "Key" properties.

Currently rated 2.3 by 18 people

  • Currently 2.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 5/31/2011 at 9:13 AM
Categories: Connected | Connected | Connected | Connected | Connected | Connected | Connected | Connected | WCF | WCF | WCF | WCF | WCF | WCF | WCF | WCF | WF | WF | WF | WF | WF | WF | WF | WF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

First Speaking Engagement of 2011 ON WF4 on AppFab

Looks like I was chosen to present at South Florida's CodeCamp! February 12, 2011 I will be heading down to talk about WF and Windows Server AppFab. Register here and come see my talk!

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/16/2010 at 7:03 AM
Categories: Connected | WCF | WF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

North Florida TechEd 2011 In Atlanta, Ga

Wow...it is great to be back from vacation...does that even make since? My first long vacation in a year. So what about TechEd? It is sad to say that my first TechEd experience was last year in New Orleans. Talk about blown away! I never want to miss another...In fact, I just submitted a couple lf sessions on WF to see if I could have the honor of presenting next year.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 11/28/2010 at 3:11 PM
Tags: ,
Categories: WCF | WF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Gave My Session On Hosting WF4 Within AppFabric at Tally's Code Camp

Just finished my session on hosting workflows using WF4 in Windows Server AppFabric! I actually thought that I might not have enough demos for the session time, however my work paid off last week and I made more than I could show. First I showed how to build a custom workflow host with persistence. I demonstrated that I could shut down the host and pick back up where the workflow left off. Then I moved to building a workflow exposed as WCF. I showed how this was using raw ADO.Net but also showed how Entity Framework 4.0 could be used as well. Finally I pushed the workflow service into AppFabric and connected a client to it. On purpose I added more characters than the database field could hold so that the call would fail. I did this because I was able to work with the monitoring senarios with AppFabric when I got the same error by mistake:(. This was a nice turn into how AppFabric worked and how monitoring could be used to detect the errors that the client app could not see.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 10/23/2010 at 5:08 AM
Categories: Connected | WCF | WF | Windows Server AppFabric
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Workflow Persistence is Not Fully Functional Because the Net.Pipe protocol is Missing

You might not see this error until you start deploying workflow services to Windows Server AppFabric and configuring persistence or host management!

 

 All it means is that you need to add "net.pipe to the list of protocols the applicaiton can use. To do this

  1. Click on the deployed Application
  2. Click "Advanced Settings..."
  3. Look for "Enabled Protocols" which probably has "http" already added
  4. Add ",net.pipe" like below

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 10/21/2010 at 9:23 AM
Categories: Connected | WCF | WF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Calling Up WCF From Powershell

Microsoft Dynamics has a standard API called a Business Connector and while there is no activity, it sometimes it drops the connection. I was hoping to build logic that would catch these types of situations, however I could not get the BC to play fair. I already had a WCF service that communicated with the BC I just needed to add a script that I could set up as a scheduled task and some Dynamics static calls that I could use to ping the BC. If you don't have Powershell you can pick it up here.

My first challenge was how to call the WCF service. I decided to use Powershell by which I found a great resource for calling WCF services. After reviewing info I was able to create the following script...

svcutil.exe http://localhost:8731/DAX/BusConnect/
csc /t:library BusConnect.cs /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll"
[Reflection.Assembly]::LoadWithPartialName("System.ServiceModel")
[Reflection.Assembly]::LoadFrom("$pwd\BusConnect.dll")
$NetTcpBinding = new-object System.ServiceModel.NetTcpBinding
$endpoint = new-object System.ServiceModel.EndpointAddress("net.tcp://localhost:8085/DAX/BusConnect")
$secMode = new-object System.ServiceModel.SecurityMode
$NetTcpBinding.Security.Mode = $secMode;
$NudgeService = new-object BusConnectorClient($NetTcpBinding, $endpoint)
$NudgeService.DAXNudge()

So essentially you...

  1. Create the proxy code through the SDK's svcutil command
  2. Compile the code referencing the ServiceModel.dll
  3. Use reflection to load the compiled dll referencing System.ServiceModel
  4. Create the binding...In this case I used TCP
  5. Setup an SecurityMode...In this case there is 'None'
  6. Assign it to the binding
  7. Create the new service call
  8. Call my method on the service

To create the script open up Notepad and paste in the script. When you save the file use the .PS1 extension. Now to make sure your script knows about SvcUtil and where to find System.ServiceModel, you want to find where they are located on the system and added to the Environment Variables, "Path". You can do this easily by left clicking on Computer and going to properties then Advanced System Settings and clicking on the Advanced tab

Now that the paths are added to the Environment Variables, you need to setup PowerShell to run scripts...Follow the guide here. Once setup, run the scripts by starting up powershell following the guide.

Finally, after I know the script runs I need to add it as a scheduled task. For Vista, watch this quick video. To set it up on Server 2003, it should look like this

  1. "Run as:" should be the account the task will "run as"
  2. "Run" Powershell path and the file to run...ex. C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe .\NudgeBusConn.PS1
  3. "Start in:" Where the powershell script is located...ex. "C:\Program Files\Company\BusinessConnectorWakeUp"

Something that is extremely important is that when I pushed this to production, I excluded the SDK from the server. For security reasons this is not a could practice. Instead, just copy the proxy files and compiled code to prod and take out the script that was building these files. Overall I have had a great taste of what powershell can do. I think it is very powerful and can be used many ways for automation or writing code and thinking outside the box. More importantly, Powershell activities will be introduced within WF 4.0, so now seemed like a great time to understand senarios for when to use it.

 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 3/4/2009 at 3:36 AM
Categories: Connected | WCF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (369) | Post RSSRSS comment feed

Getting WCF To Work With SQL CLR Objects 64bit Environment

This past week I have been wrapped up in moving our integration services between Microsoft Dynamics AX and our line of business applications. If you have seen some of my past posts, it will show that I chose to use WCF and Sql Server Service Broker. One of the biggest challenges was getting my WCF/SQLCLR stored procedures to work in the new test environment which happens to be 64bit. In our dev environment I did not have any trouble going from my initial 32bit to 64bit, however it had been a couple of months since I had set it up and like most things, a lot of the details I forgot. Below is a list of assemblies that needed to be added into SQL Server, but only after careful testing of each combination(64/32). If you look closely you will notice that some reference dlls in both the 64bit and 32bit .Net Framework.

Steps:

 

1.       Enable CLR Functionality in SQL Server

EXEC sp_configure 'clr enabled', 1;RECONFIGURE WITH OVERRIDE;GO2.    ALTER DATABASE [Database Name] SET Trustworthy ON 3.              

 CREATE ASSEMBLY 

 [System.Web] from 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Web.dll'

 with permission_set = UNSAFE –-Fails if not 64 on 64 bit machines

 GO 

 CREATE ASSEMBLY

 SMDiagnostics from 'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication  Foundation\SMDiagnostics.dll'

 with permission_set = UNSAFE

 GO 

 CREATE ASSEMBLY 

 [System.Runtime.Serialization] from 'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\System.Runtime.Serialization.dll'

 with permission_set = UNSAFE 

 GO 

 CREATE ASSEMBLY  

 [System.IdentityModel] from 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.dll'

 with permission_set = UNSAFE

 GO
      CREATE ASSEMBLY        [System.IdentityModel.Selectors] from 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0 \System.IdentityModel.Selectors.dll'      with permission_set = UNSAFE      GO            CREATE ASSEMBLY       [System.Messaging] from      'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Messaging.dll'      with permission_set = UNSAFE      GO            CREATE ASSEMBLY      [Microsoft.Transactions.Bridge] from      'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\Microsoft.Transactions.Bridge.dll'      with permission_set = UNSAFE      GO

A couple of other gotcha's, I was also having an issue in my local environment where the Sql CLR was having trouble loading the Microsoft.VisualStudio.Diagnostics.ServiceModelSink.dll when running my managed SPs. I found a fix here which was not so bad, except that I could not change my machine.config file. I was simply trying to open it up in Notepad and Visual Studio, make the change and save it. This did not work so after a couple of minutes of stumbling I decided to re-create it, make the modifications, save it to another location and then cut and copy it to it's original location. This allowed Vista to handle permissions and everything worked out.

One last thing, if you try and make a service reference with SQLCLR Objects by default I think it targets the 2.0 framework. Of course if you are using WCF you need to target at least 3.0 so you can have the option for setting Service References.

Currently rated 3.8 by 9 people

  • Currently 3.777778/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 2/27/2009 at 1:48 AM
Categories: WCF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (113) | Post RSSRSS comment feed

Exposing Dynamics AX Business Connector Through WCF

I finally met my objective last week of connecting with Dynamics through it's available Business Connector and wanted to share some code. If you read my last post on Dynamics AX Integration, Dynamics comes with a Business Connector that exposes code written in Dynamics syntax X++ through a .Net Interop DLL. Because of how it is managed through .Net I could not expose it through the SQL CLR and had to choose another way. WCF was a better choice because now it could be exposed as a service to other LOB applications within our organization. The hardest thing to note was how to handle the "dynamic" parameters that are exposed through the Business Connector's methods. For example, methods like createPackingSlipHeader(STR PURCH_ID, STR PACKSLIP_ID, [DATE TRANS_DATE]) are exposed through the connector like this

FBFPurchReceiptInterface.Call("createPackingSlipHeader", parmsPO.ToArray(typeof(object)));

Therefore each parameter to the method gets past through an object array. To make things even more difficult, you can't just instantiate the array initially with the number of parameters to pass, and if one is not required just pass 'null'. This logic just does not work. Instead try using the ArrayList. The below code will show you how I use two methods exposed through the connector to build a purchase order with multiple line items. The lines commented is how I experimented with nulls.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 11/17/2008 at 5:27 PM
Categories: Connected | WCF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (181) | Post RSSRSS comment feed

KnownTypes For Deserializing System.Worklfow.Activities.Rules.RuleSet Through WCF

I recently ran into some trouble with exposing RuleSets through WCF and was able to get it to work by adding some KnownTypes for the datacontract.

[KnownType(typeof(System.Workflow.Activities.Rules.RuleExpressionCondition))]

[KnownType(typeof(System.CodeDom.CodeBinaryOperatorExpression))][

KnownType(typeof(System.CodeDom.CodeFieldReferenceExpression))]

[KnownType(typeof(System.CodeDom.CodeThisReferenceExpression))][

KnownType(typeof(System.CodeDom.CodePrimitiveExpression))]

[KnownType(typeof(System.CodeDom.CodePropertyReferenceExpression))][

KnownType(typeof(System.Workflow.Activities.Rules.RuleHaltAction))]

[KnownType(typeof(System.CodeDom.CodeMethodInvokeExpression))][

KnownType(typeof(System.Workflow.Activities.Rules.RuleStatementAction))]

[KnownType(typeof(System.CodeDom.CodeExpressionStatement))][

KnownType(typeof(System.CodeDom.CodeTypeReferenceExpression))]

[KnownType(typeof(System.CodeDom.CodeObjectCreateExpression))]

Check out my response to the MSDN post

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 9/23/2008 at 1:28 AM
Categories: Connected | WCF | WF
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (49) | Post RSSRSS comment feed