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!

Advertisements

2 thoughts on “Failed to Serialize the Message Part, Ensure that the Message Part Stream is Created Properly

  1. 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

Leave a Reply

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