Thursday, December 30, 2010

Configuring BAM portal on Biztalk 2010

So, I installed Biztalk 2010 on Win2008 server with SQL server 2008 R2 on a 32 bit machine. Biztalk configuration worked smoothly as one would expect it to until the wizard tried to enable BAM portal. Biztalk configuration wizard threw an error saying "Default Web Site can't be validated". I did some research and found that almost everyone that had this error got it fixed by installing "IIS6 compatibility" role on the Server. But in my case, this role was already installed. But just to be sure, I uninstalled it--> restarted the server and installed it back. Only to find that it did not make any difference!

I tried hacking my way by physically creating BAM application on the IIS but did not work either. Since BAM is a pre-compiled version, I could not debug it as I would do in an asp.net web application. Then, I thought of creating a new website called "BAM" at the same level as the "Default Website" but on a different port (not 80). In my case, I used port 81. I ran the Biztalk Configuration wizard, pointed it to "BAM" site instead of "Default WebSite" and it worked!!

Later, I did some research and found out that this is a "bug" or a "known behavior" with Biztalk 2010 installation. It seems creating a new site for BAM is generally accepted solution.

Check out :http://social.msdn.microsoft.com/Forums/en/biztalkgeneral/thread/ef650460-c219-4b34-bc7a-41bb7e75ec81

I would like to hear from others who faced/or not faced same issue.

Monday, December 27, 2010

Biztalk and CEP (Complex Event Processing)

For people interested in integrating CEP with Biztalk, check out the white paper by Jesus Rodriguez at :

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6c1da607-4785-4668-a274-6898c38ea603

StreamInsight is part of SQL 2008R2. Do some reading on StreamInsight before checking out this paper.

This paper is very conceptual and does not provide any code snippets. If you are looking for some code samples, then use the samples that come with StreamInsight download and extend them.

Monday, December 20, 2010

Appfabric Connect Feature on Biztalk 2010

When Dublin (now Windows Server Appfaric) was close to being released, there was lot of talk around the speculative demise of Biztalk. Some of the key differentiators identified at that time were Mapper tool and ability to resume message flow using persistence data store. At that time, I wrote that it will be matter of time that these differentiators between Biztalk and Dublin will fade away (check the comment section of http://geekswithblogs.net/cyoung/archive/2008/10/15/125848.aspx). Current Avatar of Dublin aka WS Appfabric , provides the ability to persist data and supports resumption of messages. “AppFabric Connect” feature, that is part of Biztalk 2010 installation, exposes Biztalk mapper and LOB directly. So to be used with workflows, that can then be hosted on Windows Server Appfabric which in turn is part of IIS. Light weight applications does not need heavy weight Biztalk database anymore. Low latency scenarios can now easily be constructed using IIS hosting using Dublin.

Since this feature is part of Biztalk 2010 installation, Biztalk license is needed to use this feature. In future this can and will change. It will then be possible to create custom WF that can be persisted to a DB and exposed as WCF endpoints, while mapping .net types using Biztalk with same set of mapping functoids that are part of Biztalk world. And all of this will be free!

Thursday, December 16, 2010

Little trick....that will help you long way

During the process of creating cloud project using VStudio, don't forget to mark external "reference" assemblies as "Copy Local =True". If this is not done, your application will run fine on your local cloud emulator but throw an "asp.net application error" when executed on the cloud. Every dll that is referenced, other than the default dlls, that are part of cloud project, should have property "copy local = true". When Visual Studio creates deployment package for cloud, it looks for this property. It adds all the dlls with "copy local = true" in the package and when the solution is deployed on the cloud, these additional dlls are deployed on the cloud too. In the absence of these dlls, your cloud application will throw “asp.net application error”.

Tuesday, December 14, 2010

Biztalk and the Cloud

I was in NY city on Dec 1 for the Azure Firestarter event at the Microsoft Office. It was a nice overview of Azure. For past year or so, I have been thinking of getting my hands dirty with this technology. Between work and family, never really got a chance to do so. But this time, after the event I promised myself to actually put what I learnt into practice. Moreover so, because the free registration to Azure portal would expire in few weeks time.

So, I came up with a simple scenario.

1. Expose a CreditScore service using Biztalk within a firewall.
2. Publish this Biztalk Orchestration as WCF to Cloud Endpoint using WCF publishing
wizard
3. Use a simple windows client application to send a message and receive a reply from this Biztalk service exposed within firewall.

Step 1:

Create a two way Biztalk Orchestration that accepts an xml message(First Name, Last Name, SSN) and returns a message (Credit Score and Comments).



(Image 1)

Step 2.

Publish this Orchestration as the cloud endpoint.



Pre-Requisite:

1. Biztalk 2010
2. Windows AppFabric SDK 1.0
3. Windows Azure AppFabric Account to create the URL of cloud Endpoint (Free, if you have MSDN subscription)
4. Biztalk 2010 adapter pack

For details checkout : support.microsoft.com/kb/2449478

Step 2. Create a windows client to test this Biztalk service using endpoint exposed in the cloud.



Pre-Requisite for the client machine:

1. Visual Studio(2008 sp1 or 2010)
2. Azure AppFabric SDK 1.0 (to get NetTcpRelayBinding and TransportClientEndpointBehavior).

a) Open a "Windows Form Application" Project
b) Add Reference to "Microsoft.ServiceBus.dll" from location

"C:\Program Files\Windows Azure AppFabric SDK\V1.0\Assemblies\NET3.5\Microsoft.ServiceBus.dll"

c)Add Service Reference point to the URL exposed in the cloud : Sample URL:

shashiraina-demo.servicebus.windows.net/Test.Biztalk.Cloud.Orch/. This namespace in URL is created using AppFabric Account. (Image below)


(Image 2)


d) Use the proxy to generate client side objects. I used code instead of config file because, I was not able to get "TransportClientEndpointBehavior" and "NetTcpRelayBinding" to show up in Config file. This may be because I was just using a Windows Application as test client instead of "cloud" supported client. With code, I could easily use the ServiceBus namespace and get it working.

Sample client code is below:

GetCreditScore.GetCreditScoreRequest req = new GetCreditScoreRequest();
GetCreditScore.GetCreditScoreResponse res = new GetCreditScoreResponse();
NetTcpRelayBinding tcpRelayBinding = new NetTcpRelayBinding();
TransportClientEndpointBehavior clientEndBeh = new TransportClientEndpointBehavior();
clientEndBeh.CredentialType = TransportClientCredentialType.SharedSecret;
clientEndBeh.Credentials.SharedSecret.IssuerName = "owner";
clientEndBeh.Credentials.SharedSecret.IssuerSecret = "Extract this from Appfabric Portal";// (it will look something like the crossed out section in the Image 2" )
EndpointAddress endpoint = new EndpointAddress("sb://shashiraina-demo.servicebus.windows.net/Test.Biztalk.Cloud.Orch/WcfService_Test_Biztalk_Cloud_Orch.svc");

WcfService_Test_Biztalk_Cloud_OrchClient client = new WcfService_Test_Biztalk_Cloud_OrchClient(tcpRelayBinding, endpoint);
client.Endpoint.Behaviors.Add(clientEndBeh);

req.Score = new Score(); ;
req.Score.FirstName = "Shashi";
req.Score.LastName = "Raina";
req.Score.SSN = "123-234-2323";

res.Root = new Root();
res.Root = client.GetCreditScore(req.Score);

Response from the service is below: (Go Ahead and tried it out from your machine)!



Image 3


So, without punching a hole in your DMZ, you could expose your Biztalk services to outside world. I have been involved in complex configurations in ISA reverse proxy to expose Biztalk services to outside world. But using "Appfabric Connect for Services" , all these complex configurations can be eliminated. Moreover, the ACS (Access Control Services) that is part of Azure Appfabric allows creating your own plug-in security framework.