Thanks to Packt Publishing, I am pleased to offer you the opportunity to win a copy of Richard Seroter’s book SOA Patterns with BizTalk Server 2009 – a $60 value. I will even cover the shipping costs, via book mail, to any place in the world the US Postal Service will deliver to.
Here is what you need to do in order to win:
Simply let us know of a great BizTalk Tip or Trick using BizTalk 2006, BizTalk 2006 R2, or BizTalk 2009. Tell us a little about it and why it is useful. This could be as simple as a UI tip or complex as you want to make it. This does not need to be anything new, you might have already blogged about it or posted it to a forum. If so, that’s ok!
How to Enter:
1. Either post a comment to this blog post with your idea or post a link to your blog / post outlining your tip or trick.
To post a comment or link I suggest being a registered member of BizTalkGurus.com. This will make it easier to find you if you win and easier to get past the SPAM filter. In any case, your comment might not show up on the site right away.
2. Having problems posting a comment? Then just email your idea or link directly to me using the Contact link on the side of my blog.
3. All entries must be received by Thursday November 5th, 2009 at 11:59 PM Central Time.
4. The winner will be selected by Sunday November 8th and notified via email. In addition, a blog post will be made to announce the winner the following day.
5. All decisions of the judges are final. :)
I will be working with a few other BizTalk MVP’s to pick the best idea so be creative and have fun!
Dear Stephen,
I have been working with BizTalk since year 2006, prior to that I was working with .NET since year 2001.
The greatest tip / trick which I have learnt in all these years is that:
If the integration layer (BizTalk layer) of your enterprise application is heavily interacting with databases, then it is not advisable to use any type of SQL Adapter, rather a .NET Data Access Layer should be built in which each entity object should inherit from System.EnterpriseServices.ServicedComponent such that they can take part in COM+ transactions. Now this dll could be registered with COM+ using regsvcs utility. We can check it in COM+ MMC snap in. Now even if we go for multibox BizTalk installation, this data access layer would work fine.
Well, another trick. If you got to deal with large flat files of size more than 10 MB then it is wiser to use SSIS (Sql Server Integration Services) instead of BizTalk. We should spare BizTalk from doing this donkey work. Normally as EAI Architect, I recommend both BizTalk and SSIS together for meeting integration requirements.
Thanks
Ambar Ray
EAI Architect – Microsoft Technologies
Here is a really simple tip that is great to use when building demos and proof of concepts using the file adapter.
1. Create one folder (docs) and place all your test files there.
2. Configure the receive location to use the docs folder and %u201cCopy*.xml%u201d as the filter (for Server 2008, Vista and 7 use %u201c*Copy*.xml%u201d
3. Configure all your send ports to send to the docs folder with filenames like %u201cOrder_%MessageID%.xml%u201d.
When you test, select the file and use CTRL+C, CTRL+V to create a copy.
You can then test your application from one folder.
I have an e-Book copy of Richard%u2019s book and it rocks, but having a physical copy would be great! Nothing like holding part of a tree in your hand.
I think that most people that use BizTalk are at least aware of the Business Rules Engine and if they are they know that using vocabularies is definitely a %u201cbest practice.%u201d Creating vocabularies can be rather painful.
Tip 1 %u2013 Create a vocabulary not based on the process but rather on the fact source. If you have three schemas and a few .NET classes involved in the rule create separate vocabularies for each schema and for each .NET class, not a single vocabulary for the entire process. Ensure that you define all the terms that you even think you might need now or in the future. If for example you are creating a vocabulary for a Purchase Order and there is a chance you might apply a discount and change the Total node provide both a read and a write (Get and Set) vocabulary term for Total. Modifying vocabularies in the future is no fun so getting them right from the start is helpful!
Tip 2 %u2013 (This is the Real tip!) When creating vocabularies, to speed creating terms, select the item (say an Element in a schema) in Fact Explorer and while holding the mouse button drag the item to the Vocabulary tab, (the focus will shift) and then drag it to the vocabulary you wish to add the term to before letting go of the mouse button. The vocabulary wizard will launch and all you have to do is to fill in the name, and choose whether it will be a get or set term!
John Callaway
QuickLearn
You can generate C# files representing the orchestration, schemas, and maps using Visual studio if you set the following registry key.
1. Create a key called BizTalkProject at the following location: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1
2. create a DWORD key GenerateCSFiles, and set its value to 1
3. Restart visual studio, load a BizTalk project and rebuild.
Hi Stephen,
Two little tricks ive posted before from my biztalk black magic book are:
1. When you hand edit your binding files and suddenly you cant enlist ports anymore and cant work out why
http://geekswithblogs.net/michaelstephenson/archive/2008/01/12/118488.aspx#492111
2. You ge the CLSID_BizTalkPropertyBagFactory error message but you didnt really do anything and start to wonder if BizTalk just hates you
http://geekswithblogs.net/michaelstephenson/archive/2007/09/01/115103.aspx#491012
A few people have bought me drinks for saving their skin with these two babies.
Ive already got the book so im just in this for fun
Mike
Check this out if you want to win a copy of the SOA Patterns Book http://www.biztalkgurus.com/blogs/biztalk
Many people developing BizTalk applications find themselves creating maps with a lot of functoids doing a lot of logic or database lookups. These maps inevitably become large and unwieldy, and are a maintenance nightmare.
A great way to keep maps simple is to use the Business Rules Engine (BRE) for database lookups and logic operations. Before (or after, as appropriate in your case) sending a message to your map, send it to the BRE and let it do the work.
Another reason you may wish to leverage the BRE is to leverage fact retrievers. Fact retrievers are long-term rule stores that let you cache lookup values for long periods of time, and even refresh them at timed intervals. This is a great place to store frequently-accessed items like lookup tables. It’s also a lot easier to maintain than having the logic buried within your maps.
Another tip from my side:
If you are interacting with 20-30 database tables in your integration layer, you are definitely going to end up with deadlocks, because SQL Adapters are very poor in maintaining transactions and locks. So use the data access layer with objects derived from ServicedComponent as I mentioned in my earlier post as well as revisit all your stored procedures and tune them appropriately, never ever use cursors in stored procedures use DECLARE @table instead, prefer joins to super nested queries and don’t use *, use explicit column names instead for the sprocs and you can alleviate the deadlock problems in your integration layer.
Well, one more tip:
Try to make your BizTalk application as loosely coupled as possible. Use proper design patterns like recipient list pattern or process manager pattern and scatter-gather patterns for they are all loosely coupled.
not very specific to biztalk.but here is one tiny one..
#during development time, when you have multiple send and receive locations to monitor use a html page with multiple iframes to accommodate all file/ftp/sql tables locations to see all at once :),
instead of Alt-Tab
Hi Steve, Some tips I had came across while developing with Biztalk 2009 the last days:
1) Visual Studio 2008 fails to Create new BizTalk projects
I was stuck getting the error message: Creating project %u2018project name%u2019%u2026 project creation failed
Solution is going to the registry to make the following change:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}]
“PossibleProjectExtensions”=”csproj” – Original VS install reg value. “PossibleProjectExtensions”=”csproj;btproj” – Post Biztalk installation reg value
The following is the entry for the 64 bit version of VS:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}
The full post is here: http://blogs.msdn.com/biztalkcrt/archive/2009/08/21/visual-studio-2008-fails-to-create-open-biztalk-projects.aspx
And it really saved me a lot of time and headaches.
2) Constructing an If-Then-Else logic in a mapper
I needed to make this simple logical function and did not want to use a Script. Finally I came across with this post and currently I have something pretty similar working out perfectly:
http://blogs.msdn.com/chrisromp/archive/2007/05/29/to-be-or-logical-not-to-be.aspx
3) HTTP GET and HTTP POST
I needed to send messages via Http POST with parameters in plain text.
This post helped me a lot as it shows how to use the RawString class to construct the body of the message and also suggests the use of Fiddler to monitor and try your request. After having working my request with Fiddler I was able to make it work within Biztalk, realizing that is necessary to set [Content Type= application/x-www-form-urlencoded] in the send port (I commented this out in the post).
Full post: http://kentweare.blogspot.com/2009/06/adventures-with-http-adapter-and-yahoo.html
The sample is with the Yahoo API but it applies to any HTTP POST request.
4) BizTalk and COM+ Transaction
This is another problem that I faced making a POC. I had to call COM+ for making a distributed transaction and had exceptions.
After making some search I came across this post: http://biztalkers.blogspot.com/2005/07/biztalk-and-com-transaction.html
The problem was in fact the attribute %u201cRequiresNew%u201d. I changed it to %u201cRequires%u201d and everything worked out.
5) ESB Toolkit %u2013 How to invoke an orchestration within an Itinerary
This is actually something I had the pleasure to talk with Richard. I was figuring out how exactly say within an itinerary %u201cI want to call this orchestration, afterwards this other one and so on..%u201d. In fact, despite having many orchestrations deployed they did not appear on the Orchestration Service combo box to be selected in order to be invoked.
I was about to be done because I couldn%u2019t find the way to set this up and couldn%u2019t find useful help either. I only had available the 2 orchestrations that come with the ESB, not my orchestrations.
Finally this video was the only source I found about how to do that: http://cid-04bc12b1f7b2979a.skydrive.live.com/self.aspx/BlogVideos/ESBT%7C_How%7C_Two%7C_5%7C_CustomOrchestrations.wmv
The main problem is that you have to explicity register the orchestration (type and assembly) on the esb.config file. Obviously, not productive at all but that is the answer. After doing this I was able to select my orchestrations within itineraries.
6) I made some modifications on the BTSNTSvc.exe.config and after starting my host I got the error:
Error: The type initializer for ‘System.Data.SqlClient.SqlConnection’ threw an exception.
This has nothing to do with Sql indeed. The issue is in the .config where I mis-spelled something.
I think it is important to bear in mind this and the error description has nothing to do with the error itself.
Hope it helps.
If you are looking for ways to display business rules outside the Business Rule Composer, you want to look at the RuleDisplayStringExtractor object in the Microsoft.BizTalk.RuleEngineExtensions namespace. This object allows you to turn a Rule object into a human-readable business rule similar to the one displayed in the composer. This namespace also contains the RuleSetDeploymentDriver object, which you can use to programmatically import, export, deploy, undeploy, retrieve deployment characteristics, and set tracking configuration for rule sets and vocabularies.
Use the BizTalk Software Factory (www.codeplex.com/bsf) to build BizTalk solutions the easy way. This software factory supports BizTalk developers in creating a solution structure and creating artifacts, implementing best BizTalk practices.
If you are building custom pipeline components, then I guess this tip will save you lot of time
http://blogs.digitaldeposit.net/SARAVANA/post/2006/09/21/Biztalk-Custom-Pipeline-Component-Development-Tip.aspx
Developing Orchestration:
You don’t need to deploy your orchestration all the time, majority of the times you can get away by just re-gacing your orchestration dll. Example: if you are adding removing code inside your expression/message assignment shape.
Orchestration Development: TIP #2
You don’t need to have a “Construct Message” and “Message Assignment” shape inside the orchestration to construct a message. Instead you can use the “Expression” shape with the following statement
construct MSG_VARIABLE
{
MSG_VARIABLE = Helper.GetMessage()
}
for example Helper.GetMessage .NET helper method can return an xml document.
This will avoid having lot of Construct Message shapes in Orchestration saving lot of valuable space.
Orchestration Development #3
Dont forget System.Diagnostics.Trace.WriteLine and DebugViewer combination 🙂
Here is a way to figure out which Itinerary step was executed when working with ESB toolkit 2.0
http://urikatsir.wordpress.com/2009/10/27/how-to-determine-which-itinerary-step-was-executed/
I would like to share a trick that will help you to receive any messages as it is inside orchestration.
1. Create a message of type System.XML.XMLDocument in orchestration
2. Set this in the orchestration receive shape.
3. Use the RawString class provided by Microsoft and convert them to stream in a .net class
4. After deploying the solution, use passthru receive pipeline and this will allow you to recieve the raw message inside orchestration..
Let me share few more details on how the above tip is useful. This will be handy in cases where you don%u2019t want to do any disassembling of messages, but need to implement some business logic inside the orchestration.
Following was one such scenario we faced – We had to send message to destination in the order of filename. Since FTP/FILE adapter doesn’t allow ordered delivery an option was to create a custom adapter. But due to limited time, we decided to use a .net component inside above orchestration which will hold the messages received for a time period. Messages were stored inside a ‘List’ (of class with filename and datastream). Once all the messages are received the List was sorted using the filename. Then messages were retrieved from the sorted list and sent to the destination in a loop.
I received one via email on Monday from Randal van Splunteren I wanted to post here. Link: http://biztalkmessages.vansplunteren.net/2009/10/30/expressionmaximizer/
These are all god tips! It’s going to be hard to pick a winner.
DON%u2019T…
…load the entire message into an XmlDocument in a pipeline component
DO%u2026
%u2026use forward-only streaming instead (http://blogical.se/blogs/mikael/archive/2008/09/21/screencast-building-pipeline-components-with-forward-only-streaming.aspx)
USE%u2026
%u2026tools like PAL and LoadGen to test your environments and solutions (http://pal.codeplex.com & http://www.microsoft.com/downloads/details.aspx?FamilyID=c8af583f-7044-48db-b7b9-969072df1689&DisplayLang=en)
LEARN%u2026
%u2026about automated deployment (http://channel9.msdn.com/posts/johanlindfors/MSDN-TV-Use-Team-Foundation-Server-for-BizTalk-Server-2009-development/)
BUY%u2026
%u2026the book if you don%u2019t win it, it%u2019s a great book(http://www.packtpub.com/soa-patterns-with-biztalk-server-2009/book)
Tip: – If there is process triggered by Database Polling, then BizTalk designer has to think of using BizTalk adaptor for Database Polling operation. Generally this requires a stored procedure with custom schema generated by BizTalk. There might be changes in the stored procedure as per project requirements, which impacts schema directly and shaken significant part of solution results in rework. Using SELECT AS statement in the Stored Procedure will make sure that it will not impact the custom schema in some cases.
e.g.
SELECT DISTINCT ir.EMAltMsgId AS ID,
CONVERT(VARCHAR(10),ir.ReqRcvTs,101) AS FileDate,
ir.Acct1st11DigNo + ir.AcctLst4DigNo AS Account,
ir.MailCd+ir.BagId AS BagID,
XML AUTO, ELEMENTS
This will make sure that even if there are changes in the Stored Procedure logic the schema will have following elements.
ID, FileDate, Account and BagID.
Resequencer pattern – a scalabale approach
if you intend to implement end-to-end ordered processing using ESB Toolkit 2.0 and moreover wish to ensure that the solution be scalable then there is one small caveat which needs to be overcome. That is dynamic send ports do not support ordered delivery property. Now in order to overcome this the following needs to be done.
1. In the orchestration receive port set the ordered delivery to true.
2. It is assumed that BatchID would be there for a batch of messages, hence use that in correlation set to set up a sequential convoy such that only one orchestration instance serves a batch of messages. For next batch another instance and so on.
3. Add a SequenceNo to the property schema and set its property schema base property to MessageContextPropertyBase.
4. Within orchestration, depending upon the message content, set the SequenceNo of the message and use an updategram to push the message to a SQL Server table. The stored procedure used for this purpose should fill the value of an extra “status” column as “Initialized”.
Now another orchestration has to be used. For this first add a receive location with adapter as SQL Adapter.
5. The SQL adapter polls the table where message is srored and picks up one message with highest/lowest SequenceNo value depending upon in which order you wish to process the messages. Upon picking up the message the “status” column should be updated to “Processing” such that when SQL adapter tends to pick up another message from the table eventually to fire another orchestration instance, it finds that the message with highest/lowest SequenceNo has status as “processing” and it doesn’t do anything.
6. Once the processing is over, at the end this orchestration uses an updategram to change the status to “Completed”.
7. The SQL Adapter at the receive side continues polling and finds that the message with highest/lowest SequenceNo is having status as “Completed” and hence it goes ahead and picks up the next highest/lowest SequenceNo message.
Thus end to end ordered processing is ensured irrespective of whether you use MSMQ at the receive side or not. This solution would give optimum performance alongwith high scalability as no in-memory processing is done like normal resequencers in BizTalk. So even if thousand messages arrive in a batch, it would pose no problem to the application.
Hey i am newbie in this biztalk world,but i have had one hack on this
We all have faced this issue,sometime when you make changes in your orchestration and build it,it sometimes fire eror saying “ERROR IN ONE OR MORE CHILD”,so instead of doing or changing anything else just right click your orchestration and open it with your fav. editor and try to locate the error text,when you find it just delete that text from orchestration xml,now again try to rebuild…ERROR IS GONE….:)
Hi,
This one would be useful for those dealing with BRE.In BRE we dont have a provision of IF-ELSE-IF condition and so all rules are executed as such.To over come this we use NAF to implement such condition.
I go with normal Action -THEN sequence and then put a Hault and clear all rule firing in the action of each rule to stop the execution.
This way IF-ELSE-IF can be implemented without using the NAF..
The Business Rules Engine (BRE) for database lookups and logic operations is really handy in looking for maps. Is there any way to generate C# files representing the orchestration, schemas, and maps besides using Visual Studio?
hi all…
I’m getting d following error when ever i opened sql ..i tried many sources to solve dix problem…plz help me ….
TITLE: Connect to Server
——————————
Cannot connect to RAJI\SQLEXPRESS.
——————————
ADDITIONAL INFORMATION:
The type initializer for ‘System.Data.SqlClient.SqlConnection’ threw an exception. (System.Data)
——————————
The type initializer for ‘System.Data.SqlClient.SqlConnectionFactory’ threw an exception. (System.Data)
——————————
The type initializer for ‘System.Data.SqlClient.SqlPerformanceCounters’ threw an exception. (System.Data)
——————————
This operation is only supported on Windows 2000 SP3 or later operating systems. (mscorlib)
——————————
BUTTONS:
OK
——————————
Hi,
I would like to share a trick that would help you when you dont have the access of client webservice.
1.get the wsdl file from client(open ws at client place and save it).
2.Use Java NETBeans tool,Create Web service taking that wsdl refrence(it is very essay).
3. If you Observice this Web Service it is same as client one(Portname,Bindings,service name,message names are same)
4.Develop a Biztalk solution taking this dummy webse refrence.
5.Build and deploy the solution.
6.cofigure the application in admin console,check it with pointing to dummy webservice.
7.send MSI file to client location and instal it at client space.
8.Now change the webservice URL option by pointing to client webservice.
9.So,now you are able to process the application without changing the solution.
I Done this process,its good.
Thanls,
Purnachandra