Avkash Chauhan's Blog

Windows Azure, Windows 8, Cloud Computing, Big Data and Hadoop: All together at one place.. One problem, One solution at One time...

WorkFlow (XAMLX) Service Activity with WCF Service in Windows Azure Websites

WorkFlow (XAMLX) Service Activity with WCF Service in Windows Azure Websites

Rate This
  • Comments 1

I have downloaded pre-built WCF-WF samples from the link here:

http://www.microsoft.com/en-us/download/details.aspx?id=21459

 

After unzipping the above sample collection, I have selected WFStockPriceApplication application which is located as below:

C:\2012\WorkFlow\WF_WCF_Samples\WF\Basic\Tracking\TextFileTracking\CS

 

 

In VS2010, opening the application WFStockPriceApplication and set the XAMLX propertyCopy to Output Directory” as “Copy Always” as below:

 

To expose my Work Flow Service activity (StockPriceService.xamlx) as WCF service, I have added one WCF Service GetStockPriceWCFService.svc, to this application and set Workflow Service Activity (StockPriceService.xamlx) in SVC Markup  as below:

<%@ ServiceHost Language="C#"  Debug="true"  Service="StockPriceService.xamlx" 

Factory="System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory,System.ServiceModel.Activation,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35"%>

 

Build the service and verify that my StockPriceService.xamlx file is using “Copy Local” as true setting because it is in my final output folder as below:

 

 

Finally I can run and test the application locally with both StockPriceService.xamlx

 

 

...and with GetStockPriceWCFService.svc as below:

 

 

Now I can setup Windows Azure Website to use Git deployment method:

 

 

After opening GIT Bash windows, I walked all the way to my WFStockPriceApplication application folder and ran “git init” and “git add .” commands as below:

 

 

When I ran “git commit –m “initial commit” command I could verify that xamlx content is included into the list as below:

 

 Finally I can call “git push azure master” to publish my project and check the deployment was successful. 

 

Now, I can access the service and see that service is deployed correct and available:

 

 

In a test application I can also add this WCF service as Web References as below:

 

Keywords: Windows Azure, WCF, WorkFlow, Git, Websites

 

Leave a Comment
  • Please add 7 and 6 and type the answer here:
  • Post
  • Avkash - thanks for this sample. Is it possible to extend this so the service points to a xamlx file in a referenced assembly?

    I like to keep my service implementation separate from the azure role. In regular WCF I achieve this by having a shell .svc file that simply inherits my service definition from a referenced assembly. Is there any way to do the same thing with a xamlx file?

Page 1 of 1 (1 items)