Root Element Is Missing: Validate Your Input

Confusing exception messages is the bane of all developer’s existence. In many cases, the error you see has nothing to do with the actual problem.

Today, a message similar to the following was haunting me:

There was a failure executing the send pipeline: “Microsoft.Practices.ESB.Itinerary.Pipelines.ItinerarySend, Microsoft.Practices.ESB.Itinerary.Pipelines, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” Source: “XML assembler” Send Port: URI: Reason: Root element is missing.

Normally when this exception pops up, the first thing I do is validate the namespace and rootnode names against the expected schema to determine if they’re correct. Usually, this is where the fault will lie. Today, however, I was able to confirm that this was not the problem.

Fortunately, a simple map validation using my input showed me that one of my fields had data of the incorrect type.

Lesson: always do a map validation first.

Advertisements

About Ed Jones

Ed is a Connected Systems and .NET Specialist for RBA in the Twin Cities. Contact Ed

One response to “Root Element Is Missing: Validate Your Input”

  1. Ed Jones says :

    After almost two years after having written this post, I’ve got to admit that this whole thing feels like a cop-out to me and probably not particularly useful. Sorry about that.

    On the other side, though, it’s still a pretty good idea to run a validate on your maps!

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: