{"id":4199,"date":"2014-03-30T09:14:26","date_gmt":"2014-03-30T09:14:26","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/soap-header-serialization-error-for-custom-soap-header-collection-of-common-programming-errors\/"},"modified":"2014-03-30T09:14:26","modified_gmt":"2014-03-30T09:14:26","slug":"soap-header-serialization-error-for-custom-soap-header-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/soap-header-serialization-error-for-custom-soap-header-collection-of-common-programming-errors\/","title":{"rendered":"Soap Header Serialization Error for Custom Soap Header-Collection of common programming errors"},"content":{"rendered":"<p>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).<\/p>\n<p>I get this error at runtime:<\/p>\n<p>Type &#8216;System.Web.Services.Protocols.SoapHeader&#8217; in Assembly &#8216;System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&#8217; is not marked as serializable.<\/p>\n<p>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&#8217;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<\/p>\n<p>the same problem.<\/p>\n<p>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<br \/>\nXML Document.<\/p>\n<p>Any help is appreciated.<\/p>\n<p>Thanks<br \/>\n-Nishant<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4199","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4199"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4199\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}