Posted by: techsavygal | August 21, 2008

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 .net service/class from orchestration within a scope. He assured me that he marked all his .net classes as Serializable. However, he was getting the following error when he was trying to debug his orchestration in the debugger.

Type ‘CRMService’ in Assembly ‘xyz.Components, Version=, Culture=neutral, PublicKeyToken=8c1b08fd9e7f291b’ is not marked as serializable.

Upon further investigation, we found that he was trying to initialise his message with an instance of his XMLSchema class. However, i guess we basically assumed everything in Biztalk to be serializable. However, the XMLSchema class need not be serializable and hence, one has to serialize them seperately using binary formatters.

Also, one needs to be sure all the data before the send shape is serialized as the “Send” in an orchestration, is a persistance point where the data will be serialized before sending it out.

Incase you are encountering this issue before you reach the XMLSchema instance, ensure that all .net classes are marked as Serializable with the Serializable attribute and all classes contain default constructor.



Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s


%d bloggers like this: