Tuesday, September 25, 2007

BizTalk Error 916 duplicate 'Microsoft.XLANGs.BaseTypes.DesignerPosition' attribute

If you receive the following error while building an BizTalk orchestration:

Error 916 duplicate 'Microsoft.XLANGs.BaseTypes.DesignerPosition' attribute

you now know that it's because you've copied a shape from orchestration A' to orchestration A, while A' has been a copy of A before. Because (only?) this copy produces a new orchestration shape in A that has the same GUID as the already existing shape.

I guess, this error message pops up really, really seldom :-)

Wednesday, September 19, 2007

Export/Import large amounts of Parties using BindingImport

The party management of Biztalk gets a little bit slow and unhandy with a a large amount of trading Partners.
Exporting about 12.000 BizTalk parties with the Binding Export tool takes about 6 hours on a fast machine resulting in a 200 MB XML binding file.

For an import in smaller slices you can split the binding file in smaller pieces with a small program using XPathNavigator and XmlTextWriter:
XPathDocument xPathDocument = new XPathDocument (@"Bindingfile.xml");
XPathNavigator nav = xPathCocument.CreateNavigator();
XPathNodeIterator partyCollection = nav.Select("/BindingInfo/PartyCollection/Party");

Iterate over the partyCollection and create XML documents
XmlTextWriter xmlWriter = new XmlTextWriter(@"SmallBinding.xml",Encoding.UTF8);
xmlWriter.WriteStartDocument();
xmlWriter.WriteStartElement("BindingInfo");
xmlWriter.WriteStartElement("PartyCollection");
...

Finally use BTS-Task to import the slice:

Process process = new Process();
process.StartInfo.FileName = @"C:\...\BTSTask.exe";
process.StartInfo.Arguments = "importbindings -Source:" + @"SmallBinding.xml";
process.Start();
process.WaitForExit();

Thursday, September 13, 2007

Limitations in EDI pipeline and Direct Submit Port

We found two limitations with BizTalk 2006 R2 Beta2 (and RTM Bit's):

(a) Invoke a direct submit port inside a biztalk orchestration (you have to implement and invoke a web service for direct submit)

Thanks to Vishy (http://geekswithblogs.net/Vishy/archive/2005/10/06/56217.aspx)


(b) Using the EDI send or receive pipelines in conjunction with the MSMQ adapter (you can use the FILE adapter, though)

There was a failure executing the receive pipeline: "Microsoft.BizTalk.Edi.DefaultPipelines.EdiReceive, Microsoft.BizTalk.Edi.EdiPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "Pipeline " Receive Port: "ZES.ReceiveEdi.FL_Batch" URI: "FORMATNAME:DIRECT=OS:.\PRIVATE$\TESTMSMQ" Reason: The integer property value is not valid.



Microsoft will release a hot fix for this issue!

Wednesday, September 12, 2007

Sending large messages to MSMQ via Dynamic Send Ports

I had troubles figuring out how to send large messages to MSMQ when using a dynamic send port in BizTalk. Developing a connection to MSMQ with "late binding" is straightforward, as you just have to configure a send port - however, doing this via code is less easy.

However, if you follow these steps, it's not a big clue:

1. Create a queue in Computer Management > Services and Applications > Message Queuing.

2. In your BizTalk Projekt, import the library Microsoft.BizTalk.Adapter.MSMQ.MsmqAdapterProperties.dll, stored in %Program Files%\Microsoft BizTalk Server 2006.

3. In a construct message shape, assign the following port properties to the output message:

// to set the admin queue:
Message(MSMQ.AdministrationQueue) = @"FORMATNAME:DIRECT=OS:.\PRIVATE$\MSMQADMINQUEUE";

// to make it transactional:
Message(MSMQ.Transactional) = true;
Message(MSMQ.MaximumMessageSize) = 10240;
Message(MSMQ.SegmentationSupport) = true;

// to assign a special name:
Message(MSMQ.Label) = System.Convert.ToString("ABC");

... and define the target MSMQ queue in the send port object:

SendPort(Microsoft.XLANGs.BaseTypes.Address) = @"msmq://FORMATNAME:DIRECT=OS:.\PRIVATE$\TESTMSMQ";


Voilà!

Thanks to Scott Colestock (http://www.traceofthought.net/PermaLink,guid,cbd9b038-f952-479c-85b2-84398c451623.aspx) and MSDN's MSMQ Properties Page (http://msdn2.microsoft.com/en-us/library/aa577593.aspx)

Opener - or: This developer is (not only) driven by chocolate



My first entry shows an important piece of motivation: an extra large chocolate that I just received as a gift from one of my colleagues. So, if you ever need an answer to a question, don't forget to send some chocolate! ;-)

In my daily work as a software developer, I'm used to fight with computer systems. After finding a lot of solutions in blogs, I decided to make up my own blog to publish this or that solution to a pitfall that I discover (or think to discover).

Have fun!