Thursday, July 29, 2010

System.MissingMethodException was unhandled

I have been creating a "string array" for use in a BizTalk orchestration. My first version was quick and dirty, and I didn't implement the IEnumerator interface.

Later, I decided to implement IEnumerator (and IEnumerable) so that it would be more recognizable to the next person reading my code. Everything compiled and a test program started, but the above exception was thrown when the client tried to call the Reset() method.

One thing that I didn't realize was related was that the debugger wouldn't step into my code. I saw the message below when I tried to do that:

---------------------------
Microsoft Visual Studio
---------------------------
The following module was built either with optimizations enabled or without debug information:

C:\WINDOWS\assembly\GAC_MSIL\AtlasReo.BizTalk.Utils\1.0.0.0__799aa29801fe6d60\AtlasReo.BizTalk.Utils.dll

To debug this module, change its project build configuration to Debug mode. To
suppress this message, disable the 'Warn if no user code on launch' debugger option.
---------------------------
OK
---------------------------

As many people reading this have probably figured out by now, I had an older version of my string array class in the GAC. Oops.

Pulling the assembly out of the GAC solved the first issue, and then I could also run the debugger on the assembly code.

Wednesday, July 28, 2010

BizTalk "Errors exist for one or more children."

I used to see the error "Errors exist for one or more children." a lot in BizTalk 2004 when I was creating an orchestration. The error wasn't valid, because I could usually get rid of it by saving and then deleting code from an Expression shape, then compiling, then copying the code back, and compiling again.

I had not yet encountered this issue with BizTalk 2006 until today. This time the error was tagged to my Loop shape. I was able to fix the error by deleting the code from an Expression shape inside of the loop, and proceeding as I describe above. I'm just glad that I didn't have a large number of expression shapes inside of my Loop, because there was no way for me to identify which Expression was causing the error.

Tuesday, July 27, 2010

BizTalk 2006 Envelopes

I've been working on a BizTalk 2006 project lately. I was pleasantly surprised to find out that using an envelope schema for debatching is easier than I remembered from when I worked with 2004.

In my case, I had a schema whose records looked something like this:
<root>
<header>child elements omitted!</header>
<body>child elements omitted!</body>
</root>

All I did was to create 3 schemas, one for the envelope, and one each for the header and the body. The envelope schema had the Envelope property of the Schema node set to "Yes", and the Body Xpath property of the "root" node set to:

/*[local-name()='root' and namespace-uri()='']

I created the schemas for the header and the body directly from samples I made by cutting and pasting from the large message.

I then deployed the schemas, set up a receive port / location, and 2 send ports with filters to grab the messages based on the receive port and the message type. Here are the results:



I remember this being more difficult in BTS 2004, I think I created a pipeline component to make this work. I'd like to test this out, but I don't currently have access to a BTS 2004 installation.