SerializationException while calling .net classes from Orchestration!

Recently, one of my colleagues had a weird error while trying to invoke a webservice from his orchestration.Even though i was not really peeping over his shoulder, i guess he was trying to call .netservice/class from orchestration within a scope. He assured methat he marked all his .netclassesas Serializable. However, he was getting the following […]

Event Log Monitor

I’ve created a nice little tool I’m using more and more. As a BizTalk Administrator, I’m constantly needing to ensure nothing is going wrong on my servers. I need an alert process that could email me if/when there is a problem. I’ve created an event log monitoring tool that will email me depending on the search criteria I specify. I’ve included a feature that allows me to create multiple emails depending on the exact error. I use this quite a lot if a specific user needs to only know about their particular error.

The program is a single executable.

It is executed via the command prompt and takes the following parameters, which can be in any order.

-TOEMAIL: = ToEmail (Required) Can include multiple To Email addresses.
-FROMEMAIL: = FromEmail (Required)
-SMTPSERVER: = SmtpServer (Required)
-NUMBEROFDAYS: = Number of Days to look back (Optional) if not set to today’s data
-NUMBEROFHOURS: = Number of Hours to look back (Optional) if not set will use -NUMBEROFDAYS
/n = Send Email if there are no events (Optional)
/e = Send Errors (Optional)
/w = Send Warnings (Optional)
/i = Send Information (Optional)
-EVENTSOURCE: = Event Source (Optional) Can include none or multiple Event Sources to include in the search
-EVENTCATEGORY: = Event Category (Optional) Can include none or multiple Event Categories to include in the search
-EVENTMESSAGESEARCHSTRING: = Event Message Search String (Optional) Can include none or multiple Event Message Strings to include in the search

I usually set up a batch file that is run on the Windows Scheduler and sends me an email every night for the previous day’s information.

For example, I have the following event log:

I would like to receive an email for all the Events of Type Errors in the “BizTalk Server 2006” Category over the last 5 days. I would execute the following command at the command prompt:

“Generic Event Log Emailer.exe” -TOEMAIL:jstott@stottcreations.com -FROMEMAIL:MYBIZTALKERRORS@Biztalkerrors.com -SMTPSERVER:yoursmtpserver.com

-NUMBEROFDAYS:5 “-EVENTCATEGORY:BizTalk Server 2006” /e

Alternatively, I would just create a batch file with that string and schedule it to execute every 5 hours.

I then get an email every 5 hours with all the information I’m looking for.

Don’t forget that you can also search using the -EVENTMESSAGESEARCHSTRING: parameter. Using this parameter, you can really narrow down your search to specific messages.

Here are my list of planned upgrades:

1. Add regular expressions to the -EVENTMESSAGESEARCHSTRING: parameter

2. Add -EXCLUDE parameters to allow you to exclude Source, Categories, or Messages instead of only including.

3. Add the other Event Logs besides the Application Event Log.

4. Create a real time monitoring tool that would push errors to you as they happen instead of pulling them at certain intervals.

If you have any other features you’d like to see in this product, please email me.

More Information on Processing MSMQ Messages in FIFO Order

In two of my previous posts  I talked about processing MSMQ messages in FIFO order with WCF.


The way that WCF, along with the MSMQ binding, works there could be a couple of situations in which messages may actually not process in FIFO order. 


The most prevalent is a rollback.  When a message is rolled back the process is asynchronous and thus end up not only having that message take time to get back to the head of the queue but may also lead to messages being processed while the rolled back message is in flight. 


However, not all is lost.  By adding the changes below you can further ensure that you can make WCF behave like a pure System.Messaging coded system and still get your messages in FIFO order.


So, add


<transactedBatching maxBatchSize=”1″/>


as an endpoint behavior and setting


ReleaseServiceInstanceOnTransactionComplete = false


on the Service Behavior (along with the InstanceContextMode and the ConcurrencyMode)

More Information on UpdateGrams

In previous blog posts I have mentioned this large project that I am working on.  This project has been a great project for finding lots of material to blog about.  What I have not mentioned so far are the people that I am working with. 


This project is a joint effort between Microsoft Consulting Services and Microsoft Global Services India (MGSI).  There have been great contributions by all of the off-shore team (unfortunately, far to many to list) and I would recommend them anytime as an off-shore group if you are looking to implement an off-shore model. 


I have been very fortunate to be working closely with a small tight knit sub team.  This team is made of up Vishal Agrawal, Ashish Mehndi, Ashish Shukla and Benny Matthew.


Why do I bring this up?  Well, in the last blog post I talked about changing the config file so that we could validate our canonical messages.  Once we did that we quickly found out that all of our interchanges that utilized a SQL UpdateGram broke.  They broke because the map that generates the UpdateGram uses a character to represent the parent/child relationship.  This character gets mapped to an element that is an Integer type – which is were it no longer conforms to the schema.  We did this because when the UpdateGram was sent through the Send Port the SQL Adapter uses SQLXML which takes that character data and replaces it with the value of the parents primary key.


So, the first thing that we did was to modify the map to use a numeric value (yes, numeric values can be used) and we decided that we were going to use the following scheme so that we would not overlap with real data.   We used a script functoid with the following code


System.Int32.MinValue.ToString() + the value from the iteration functoid.


Why do I bring up the issue with overlapping data?  Well, that brings us to the second interesting (and important) fact about using the UpdateGram. 


How does the SQLXml functionality work internally when replacing the child key with the value from the parent?  Well, it takes the identifier (lets say that we were still using a character and that the character was Y) and does a string replace.  The string replace however is done across all of the data in the child record and not just the child foreign key column.  We found very quickly that all of our columns that contained a Y were now replaced with the value from the parent key relationship – definitely not what we wanted!  This only happens if the data in the field is only a Y.  This does not happen if there is a Y in the middle of a word.


So, if you are still going to use character data to identify your relationships in the UpdateGram make sure that you take this into account.

Odds and Ends

A couple things to share on this glorious Wednesday. 
First, one of our BizTalk developers came across an odd scenario, and I just learned that everyone’s favorite Dahan (Yossi Dahan) wrote about it a couple years ago.  Our issue was that an orchestration needed to consume a service with a multi-part input, but the complex […]

Screencast – Configuring Services with Endpoints

As promised, here is the second installment in the screencast series around the WF and WCF technologies – a weekly .NET developer screencast series to show how to accomplish tasks in WF/WCF 3.5 and Visual Studio 2008. As I mentioned last week, we’ve partnered up with PluralSight to deliver high-quality, task-specific screencasts that are short and to the point. The screencast videos will be published up to Channel9 on Wednesdays, available for either watching from the server or for download.


This week, for our second screencast in the series, CSD MVP Aaron Skonnard walks you through how to configure your your WCF Service with endpoints. The screencast guides the viewer through the XML configuration for an existing service (see last week’s screencast on how to create one) – examining the adapter, binding, and contract settings for the service – and then using the WCF Configuration Editor tool to add additional endpoints to the service. Along the way, Aaron introduces the concepts of base addresses, the MEX binding, and the non-HTTP bindings.



As mentioned above, the WCF screencasts are a weekly series of Channel9 videos done in conjunction with the folks at PluralSight to help developers new to WF/WCF see how the technology is used. It’s worth noting that Aaron and the PluralSight folks are now offering online training courses (in a format similar to these screencasts) as a compliment to their catalog of instructor-led training courses covering Microsoft connected systems technologies. Their training topics range from .NET v3.5 (including an excellent WF/WCF Double Feature course) to WSS to BizTalk server.


Side Notes:
Yes – I’m still using an image in the post and linking to the Channel9 posting, as opposed to an embedded viewer…and let me tell you why: Since last week, I caught up with Matt Winkler on how to do embedded videos from Channel9, and he explained how to do it (pretty simple, actually). But it seems that it comes down to a choice between either doing this as a screencast (where it automatically opens up the video in a new window) or as a player embedded in the page – I’m unable to get both. So…
going the other way, we get the upside of the ability to embed it…BUT…the downside is that the graphic in the Channel9 post no longer opens a new window when you click on it – it plays it in the small, low-res box; and users have to then click the ‘Download’ and ‘Screencast’ links to get a high-quality streaming play of the screencast. Because I’m assuming that most folks don’t know that they can get to the screencast via the ‘Download’ link, I didn’t go that route. But, that being said, I’m willing and able to be swayed on the issue. So drop me a line either in the comments section below, or via e-mail if you feel strongly one way or the other.


Also, I promise to drop the introductory paragraph next week. ^_^

SAP ADO – Design Time helper tool

Attached to this post is a standalone .NET Windows Form application which can be used to browse artifacts on SAP, and build queries which the SAP ADO.NET provider can understand. The main aim is to reduce the grunt work required when building the queries.


The provider supports EXECuting RFCs, SELECTing from a single table, and SELECTing from two tables (JOIN). The tool I’ve attached currently supports EXECuting RFCs and SELECTing from a single table; support for generating queries which use a JOIN will be added in a later version.


The current version of the tool is linked against the 32 bit version of CTP3 of the BizTalk Adapter Pack V2. I’ll update the attachment as and when newer versions of the Adapter Pack are released.