My blog has moved!

Visit http://blog.adamroderick.com/ and update your bookmarks.

Wednesday, April 25, 2007

Error: "A correlation may be initialized only once"

I have seen this error in two situations.

1. You have two receive or two send shapes that both initialize the same correlation set. This one is easy to figure out. In my case, I have two points in a single orchestration where I wanted to send a reject message to the same port. I ended up naming the correlation set for the first send shape "rejectProperties" and the second "rejectProperties2," and both were of the same correlation type.

2. The second situation was not intuitive. My send shape was in a loop, and the compiler interpreted that to mean that there was the potential of initializing the correlation set for that send shape multiple times. The way around this was to put my send shape in a scope (I used a non-transactional scope). I then created the correlation set as local to the scope rather than on the global orchestration level.

Labels:

Tuesday, April 24, 2007

EmptyPartException

I did not find very much useful information online about this. It happened because of the following code snippet in an expression shape:

Message1 = new System.Xml.XmlDocument();

Message1 was defined with a specific type, but its .NET type is XmlDocument. So I was allowed to assign the new XmlDocument to the message, but sometime after the assignment BizTalk wised up and realized that the contents of the message were empty (and thus did not match the message's schema).

Labels:

Filters using strings

If you have a filter on a receive shape in an orchestration, use quotes for a hard coded string. For example, I wanted to subscribe to messages with a BTS.Operation of "Operation1" You must use quotes.

However, if you configure a send port using the Administration console, the same filter would subscribe to BTS.Operation of Operation1, without the quotes.

Labels:

Using xpath() function -- the namespace was not expected

I got this error when using the xpath() function in an expression shape. Turns out I was access a node instead of its contents, then trying to do a toString on the results.

http://www.topxml.com/rbnews/BizTalk-Server/re-50155_BizTalk-Server-2006--An-xpath-Function-problem.aspx

Labels: