Monday, January 28, 2008

Tokens in Internet Service Bus


Token providers are part of Identity Services in WF, they are typical username, password authentication as you see in the traditional web programming.

Biztalk new release supports two Token Providers

1. CardSpaceTokenProvider
2. AutomaticRenewalTokenProvider

I was using the option 1 in one of my sample application (MarketData Broadcast) in my forth coming article, over the period of time "CardSpaceTokenProvider" tries to renew the token by providing the Cardspace user interface, failing throws the following error

System.ServiceModel.Security.ExpiredSecurityTokenException: The Infocard token created during channel intialization has expired. Please create a new channel to reacquire token.

This can be good for the short running process.

AutomaticRenewalTokenProvider is as similar to the CardSpaceTokenProvider , but renewing the token automatically in the long runing process.

Choose your Best Token provider..

Friday, January 25, 2008

Callback Contract on Windows Communication Foundation (WCF)

In the duplex mode communication, WCF Service supports Callback Contract. What does it mean?. Duplex communication is fairly simple as “Walkie-Talkie”. While Client calls Service , Service notifies back “hey I am doing it, will give you result back once I am done” and returns the result or none.

Here is a simple version of the concept..




Step 1 : Client calls a Method in Service

Step 2 : While executing the Server.Service method, service calls back a method on client side. Normal case the client method would update the user screen on the client with messages like “ Processing…”.

Step 3: Service returns result /void back to the client.

Monday, August 27, 2007

Repeating Tag Identifiers in Flatfile schema

It’s been long time since I have blogged, Yeah, Its pleasure designing interfaces for a finance concern integrating with Legacy and SAP Systems. We work for a aggressive dead lines (why does this word sounds weird :) ) and implementation. Last week a colleague of mine was creating a flat file schema for the billing records that we receive from Mainframe systems. He had a problem in grouping each Header, List Group and List Items in the output XML.



Here is the structure of the input flat file




Scenario


Each bill starts with bill header "BHR", each bill can contain multiple Line Item Groups (BLG) and Line Items (BLS). Bill doesn’t contain trailer row. Columns in the header, Line Group and line items are separated by comma.

Expected output is as similar as



I marked "BHR" as child delimiter (usually \r\n huh?) for the root node "Bills", since each bill is separated by the Tag Identifier "BHR".


Our initial schema design for the above problem was


Changing BLG or BLS Repeating record’s maxOccurs property as "*" unbounded did not solve our problem. We got only the first occurrence of BLS and BLG nodes as output.


Parsing Multiple Repeating Tag Identifiers under single record does not work as expected in BTS06.


To solve this issue I have done the following.


1. Added a "Choice Group" Schema node under the Root node
2. Moved "BLG" and "BLS" repeating records under the "Choice Group".
3. Changed the "maxOccurs" property of the "ChoiceGroup" node as "unbounded".


That’s all, it worked.



If you look at the third ListItems Node you can see BLG and BLS nodes repeating more than one time here (Marked in box).

I am sharing my sample flatfile and schema here ( Blogspot help us sharing files).

Happy Biztalking..

Thursday, April 05, 2007

Designing Biztalk Schema

I have recently posted an article series of Designing Biztalk 2006 Schema in code project site.
here is the link :

http://www.codeproject.com/useritems/designbiztalkschema1.asp

Wednesday, January 24, 2007

Read your Application Name in Pipeline and Orchestration

I have seen few guys asking in newsgroup about reading Biztalk “Application Name” from pipeline and Orchestration. You can access the application name using
BTSCatalogExplorer and Microsoft.BizTalk.ExplorerOM.ReceivePort classes.


private string GetApplicationName(string ReceivePortName)
{
string retValue = string.Empty;
BtsCatalogExplorer bc = new BtsCatalogExplorer();
bc.ConnectionString = "Server=MyBTServer;Initial Catalog=BiztalkMgmtDb;INtegrated Security=SSPI;";

foreach (Microsoft.BizTalk.ExplorerOM.ReceivePort rcp in bc.ReceivePorts)
{
if (ReceivePortName == rcp.Name)
{
retValue=rcp.Application.Name;
}
}
return retValue;
}

The above shown method can be simply used in Receive pipeline and promote your application name in the message context, so that you can access it in your Orchestration.

Create a new property schema with “ApplicationName” and write code similar to this.



if (!pInMsg.Context.IsPromoted("ApplicationName", "http://...."))
{
string recPortName= pInMsg.Context.Read("ReceivePortName",
"http://schemas.microsoft.com/BizTalk/2003/system-properties");
pInMsg.Context.Promote("ApplicationName", "http://...",
GetApplicationName(recPortName));
}


Happy Biztalking..

Monday, November 27, 2006

Windows Workflow Toolbox

This week after thanksgiving day i installed Windows Workflow foundation in my laptop it has VS 2005 ,gone through few samples. I had created a new workflow and looked at my toolbox to drag "CodeActivity", but i could see only eight controls. Ohhh where are WWF controls ?..

After spend sometime , i found that right click on toolbox and select "Reset Toolbox" menu bring all the controls back.

I am started playing WWF, hopefully i could write somethig i experience in WWF.

Sunday, November 05, 2006

Biztalk 2006 Dependency could not be found Warnings

Last week, I was creating an orchestration which executes pipeline component to debatch messages using "ExecuteReceivePipeline" Method. That worked fantastic. But when i compile the Biztalk project it thrown many warnings as shown below.

Warning 1 The dependency 'Microsoft.BizTalk.CachingService' could not be found.
Warning 2 The dependency 'Microsoft.BizTalk.DBAccessor' could not be found.
Warning 3 The dependency 'Microsoft.BizTalk.Tracing' could not be found.
Warning 4 The dependency 'Microsoft.BizTalk.Bam.EventObservation' could not be found.
Warning 5 The dependency 'Microsoft.BizTalk.Streaming' could not be found.
Warning 6 The dependency 'Microsoft.BizTalk.XPathReader' could not be found.

I know compilation warnings are never considered in many cases, but it was little annoying to me.

After a long digging i found that the referenced pipeline dll "Microsoft.Xlangs.Engine" was copied into my local Bin directory and that tried reference the above dll's those are GAC'd and not available in my local bin directory.
I just changed the "Copy Local" property of "Microsoft.Xlangs.Pipeline" reference dll under my Biztalk project as "false" and compiled again. All these warnings disappeared.

Take away: "Copy Local" property is marked as "true" by default, when you add reference "Microsoft.Xlangs.Pipeline" dll.