Fast, Efficient Message Archiving for BizTalk with the BizTalk Message Archiving Pipeline Component. Download a Free 14-Day Trial!

Failed to Serialize the Message Part, Ensure that the Message Part Stream is Created Properly

Encountered the following error today on a SOAP [Send] Port:

Failed to serialize the message part “[PART NAME]” into the type “[MESSAGE TYPE]” using namespace “[NAMESPACE]“. Please ensure that the message part stream is created properly.

The error is a little misleading, especially ‘ensure that the message part stream is created properly‘ – the message part stream is created correctly, but it does not match the type contained within the SOAP adapter proxy and therefore fails to serialize. In our case, we were trying to serialize an element with the string ‘Stan’ into a boolean. With the best will in the world, that isn’t going to happen!

To check where the problem lies with serialization, simply validate the failed message (retrieved from the Admin Console) against the schema generated from the WSDL, using the Visual Studio ‘Validate Instance‘ schema menu option. You’ll be presented with a list of errors that can then be resolved.

Our problems went a lot further and resulted in a fairly impressive hacky bodge that I am extremely proud of, especially on a Friday at 5pm (with a Bank Holiday weekend waiting for me). I’ll spare you that for another post!

2 Responses to “Failed to Serialize the Message Part, Ensure that the Message Part Stream is Created Properly”


  1. 1 vamsi

    Hi Nick,

    Can you please tell me how you resolved this issue.In my case the xml string is sent to Biztalk from an ASP via MSMQ.From Biztalk I send that message to a Webservice with a Webmethod expecting a string input.I get the above mentioned error if a Passtrough pipeline is used and i tried to write a custom pipeline which i am having tough time getting it to work.Any advice as to if i have to use a custome receive or send pipeline.I dont have or want to use orchestration in this senario.

    Please let me know what i should do.

    Thanks,
    Vamsi

  2. 2 Nick Heppleston

    Vamsi,
    You should check to ensure you have a C# proxy class configured on your adapter – see http://seroter.wordpress.com/2007/04/02/consuming-web-services-in-biztalk-without-web-reference/ for more information.

Leave a Reply





Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Nick Heppleston’s BizTalk Blog is Digg proof thanks to caching by WP Super Cache