Wednesday, March 26, 2008

Consuming WCF Services in BizTalk Server 2006 R2 - Add generated items (WCF Services)


I was thinking a long back to come up with this article, and now just found time to write about WCF services and it's implementation with BizTalk Server 2006 R2. I have designed few small solutions in past few months to deal with scenarios like Information Integration and SOA with BizTalk Server R2, where I found the great chance to work upon the WCF adapter series as well as Web Service Factory : Modeling Edition. Both made me big fan of them, it's great to work on both, I am not focusing on WebService Factory modeling in this article but will discuss about WCF services consumption inside BizTalk and few videos might help people to work on them.

I would like to share few images below, by reading this images you can understand the service I have coded for sample, if you are interested in sample code please mail me, and I promise you will find that sample someday in you mail box... when that I don't know. :-) But will try send you soon as possible for me.

The best way I feel to consume WCF services inside BizTalk solution is by using WCF Services Consume Wizard which you can find in Visual Studio Template, this wizard will power you by generating schema and port binding configuration files for your solution based on service descriptions. Not going into deep how this work internally here but focusing on the practice I gone through.

Below image shows Generated Items and Visual Studio Template.

Please have a look to the below Video Presentation where you can find what steps I followed to generate my sample project. Hope it will surely help you in any manner while working with WCF and BizTalk together.




As result of Wizard you will get schema and binding files inside your solution, that schema will be generated on basis of the metadata of the consumed services and it could be used as multipart messages in case of request-response services. Below snaps will show you the BizTalk schema presentation against the .net message contracts and data contracts.

DataContract Source Code:


MessageContract Source Code:


Service Implementation Code:


BizTalk Schema:



BizTalk Test Message I used for my sample:


You can analyze your self the presentation of Inbound message and the Contract representation inside WCF Implementation upon the above snaps. You can consume the generated schema in routine BizTalk solutions and patterns, while deploying such solution you can use generated binding information for such implementation with Endpoint transportation and Behavior information regarding WCF hosting and services. It is very good feature provided by wizard which make our life very easy :-). Let's have a view to below video presentation on the WCF Http and Custom Adapter configuration inside through BizTalk administrator console.



Hope you liked this article and it will give you fair idea about the BizTalk Server 2006 R2 and WCF coupling in Solution, as a system/solution designer point of view I really enjoyed to work with this two made for each other technologies and it provide such ease to workout most complex scenarios regarding service orientation and integration. As well as I realize the solution's capability to work over Internet Integration where security is the major concern and we generally prefers to go with ws-HTTP or HTTP channels for integration, on such scale it can help us to give such secured integration system.

Please provide your feedback about the article at nilayparikh@gmail.com.


Wednesday, March 19, 2008

Web Service Software Factory - Walk through Video (WCF Implementation)

Recently, I got very good opportunity to work on WCF Services through WebService Software Factory, it's a really nice tool, I have seen so far to build complex WCF services in very easy manner, no really I means. Yes, there are some limitation of the tool and it's not supporting all features of WCF implementation but you can say.. it's very nice kick off point for your project and code, later you can defiantly customize your code by modifying the auto-generated code itself.

While working on factory, I grabbed opportunity to record my activities through one screen recording software and I would like to share that video among IT Professional community. Please have a look and share you view on such beautiful tool.

Service Modeling & Message Modeling walk through:


Code Generation walk through:


You can also find some more videos on below link.
http://www.codeplex.com/servicefactory

Please send me your feedback and suggestions about the above walk-through on nilayparikh@gmail.com


Friday, March 14, 2008

BizTalk 2006 R2 with PeopleSoft Integration & MicroSoft BizTalk PeopleSoft Adapter Overview

Recently, I come accords requirement to integrate PeopleSoft ERP implementation within existing ESB. I have worked on many PeopleSoft integration through BizTalk, so just taking opportunity to write something exciting about knowledge I have gathered.

MicroSoft is very much aware about importance of PeopleSoft ERP and it's huge existence in Industry, so BizTalk R2 LOB adapter set has include PeopleSoft adapter which is very useful artifact during our PeopleSoft integration, it facilitate developer in many manners like developing schemas, messages. There are few limitation also we are facing with the adapter but those limitation could be overseen with different kind of implementation patterns and of course we can archive most of requirement what we want to with the adapter. There are also many third party adapters are available for PeopleSoft integration but I have explored more, the only one third party adapter I have worked with is iWay last year, yes it is very impressive but while comparing overall prospective I would defiantly go with R2 LOB. But it purely depend on the requirement and what extend we are looking for integrate the systems.

Microsoft Line of Business PeopleSoft Adapter's Architecture.


LOB PeopleSoft adapter's Prerequisites:
# The Java 2 Platform must be installed on the BizTalk Server that the BizTalk Adapter for PeopleSoft Enterprise is running on.
# The PeopleSoft Java Object Adapter JAR file, psjoa.jar should be copied to a folder that is accessible to the BizTalk Server that the BizTalk Adapter for PeopleSoft Enterprise is running on.

Implementation & Design Patterns:
BizTalk PeopleSoft adapter facilitate your requirement to query and receive data from PeopleSoft ERP also you can do basic data operation like Insert, Update and Delete. But here one thing very clear, but it will not allow live integration from outbound direction (from PeopleSoft). To archive such requirement you can implement services inside PeopleSoft which can push live data feed into any queue or physical location where BizTalk or any external service can monitor feeds with very less latency, so how you can get such live implementation.

I would like to share the architecture, I designed for such live implementation landscape recently. You can view the picturing below.



The above architecture, I designed for the two-way integration with PeopleSoft for our client. Low latency outbound messaging integration can be archived by MSMQ or any other queuing implementation between BizTalk and PeopleSoft. Also many time in different scenario requirement we need information integration between different systems that could be archive through cutting edge technology like WCF / WSE 2.0 where BizTalk R2 provide functionality integrate such services, you can also give term like 'EII' to such implementation. More over by implementing such landscape we are moving towards service orientation and service bus. BizTalk provides a ease to integrate many systems within such implementation, also it leverage extensibility of ERP implementation.

You can also go through below links for further references at MSDN.

1. Tutorial: Using the BizTalk Adapter for PeopleSoft Enterprise to Retrieve Data from PeopleSoft Enterprise
2. Tutorial: Using the BizTalk Adapter for PeopleSoft Enterprise to Write Data to PeopleSoft Enterprise


Please provide your valuable feedback on nilayparikh@gmail.com.


Sunday, March 2, 2008

Advance mechanism to handle exceptions for .net component used inside BizTalk solution

Finally after one month’s big vacation I am writing something technical, few days back my one of good friend came to me and asking me about the exception handling inside BizTalk for those scopes which contain calls .net classes and their methods. Well, I enthused about this article, and also a good chance to document some good practices I have worked for in some previous projects to improve the exception management and automating support routing. The article also includes some videos, hope it will help you to understand my views and idea about this mechanism I am presenting here.

In every system or solution exception handling stands with primary requirement, this article is not elaborating exception handling fundamentals in .net platform but I am focusing towards exception handling in .net component which we are adding as assembly inside BizTalk Solution/Project. Those exceptions handled inside .net assembly then the question comes how we can manage execution flow if exception occurs with orchestration logical flow, need to put flags, variables, calls and then with decision shape we can route files or log it within orchestration, correct. Hummm, it’s really odd solution, it can surely fulfill our purpose but it’s not recommended. This is very heavy on orchestration as well not recommended for runtime performance of BizTalk orchestration. Well, there is always an Generic Exception we can handle inside Orchestration for any scope but it will not give specialized block to handle such exceptions like if I want to handle DivideByZeroException and NullReferanceException in different block and then I want to divert the files at different Send Port so my technical support team can look and appropriately correct them individually and send those back for reprocessing, so I can give my customers better and fast experience with BizTalk support group.


An unhandled exception inside .net class which you can surely catch inside BizTalk Orchestration as Generic Exception. But If you have requirement like you need to execute few statements to compensate and then you also want catch that exception inside BizTalk Orchestration to route the logical execution path. Bit confusing requirement but believe me it’s normal one, there you will question me, why I shouldn’t catch inside BizTalk only and execute all compensate statement inside catch block, really possible but it will be not appropriate for performance, suppose if you handled it inside .net assembly then assembly call, refection will improve run time assembly performance inside BizTalk rather then calling multiple time. Yes then the question, what to do about the logical execution flow inside Orchestration, if the requirement want to route the message to any other branch or to any send port if exception occurs, possible? We can rethrow the exception inside .net assembly’s catch block after the compensation has been executed inside code, rethowed exception will be catch by BizTalk orchestration and we can route logical flow as per the requirement.

Below picture shows the implementation for handling the rethrowed exception inside .net assembly.

You can also go through the below videos shows the complete implementation about what I have discussed.


.net Assembly implementation video

BizTalk implementation video


Hope you liked my article and might it will help you, Your valuable feedback and suggestion are welcome to nilayparikh@gmail.com