iRop's BizTalk blog

Friday, October 10, 2008

Failed to serialize message part ....

Well, I've come across this error message quite often:

Failed to serialize the message part "" into the type "" using namespace "http://namespace". Please ensure that the message part stream is created properly.

The first time you will probably end up searching what is causing the error. Generally this error occurs when the message is holding an improper value, think of a character string in an integer field, or a complex type field is empty (and not nullable). It could also be that a mandatory field is missing in the message being sent to the adapter (this won't occur when you are using validation).

Also keep into account that this error may also occur because of a weird (or wrong) WSDL / proxy class generation in BizTalk and fields become optional, allthough they are mandatory. When adding the proxy class, the schemas that are being generated aren't correct at all. E.g. all strings are generated as optional, though they may not be optional in the service contract. I will put this problem in a seperate entry next week, because it's really hard to find anything on this problem on the internet.

Labels: , , , , , ,

Monday, October 6, 2008

Errors in .NET proxy class generation and its WSDL in BizTalk

When a proxy class is generated with BizTalk 2004 and 2006 (not R2 as it seems) it will hold a few errors. It's important to take these irregularities into account (Microsoft calls it "by design").

Mandatory strings (minoccurs="1") are converted to optional (minoccurs="0"). Nullable types (xsi:nil="true"), e.g. xs:int or xs:datetime, are ignored when passing it through the proxy class.

I could try and explain the problem, though the entire "problem" can be found on the URL below. This is a Microsoft source.

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101972

Labels: , , , , , , , , , , , , , ,