Soap Header Serialization Error for Custom Soap Header-Collection of common programming errors
I have a orchestration which is exposed as a web service -asmx (actually the schema is exposed).Both the request and response messages have a custom SOAP header. Everything does work fine till the point where as part of our audit strategy, I construct the audit message (which has 2 nodes, one for the header and the other for the body).
I get this error at runtime:
Type ‘System.Web.Services.Protocols.SoapHeader’ in Assembly ‘System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ is not marked as serializable.
I know it occurrs when i send the audit message out to the message box(at the send shape) where the audit framework is directly bound. As far as i can tellthis is because once the message has been sent out to the message box BizTalk cannot persist. Has anyone faced this problem or know any workaround for this? I could use a custom pipeline to solve this (should work, haven’t tried it though) but again my orchestration does call another processwhich needs the soap header (and that assembly is non serializable and not in our control) so i do have to use an atomic scope where i again face
the same problem.
Not that it should matter but for creating the audit message we use a .net assembly which returns an XML Document and takes in the Soap Header string and Soap body
XML Document.
Any help is appreciated.
Thanks
-Nishant