Friday, October 19, 2012

System.ServiceModel.ExceptionDetail is not marked as serializable.

I have two different environments, test and prod with the same dll:s deployed, on production, the orchestration throws an error and suspends the orchestration when it tries to serialize something after a message has been sent through the outgoing port. The receiver of the message sent to "SendGeneralLog" has successfully received the message.

I figure that this error has to do with the state serialization of the orchestration. I.e. after each send or receive operation Biztalk saves the state for normal and long-running transaction scopes.

The thing I don't understand is why a 'System.ServiceModel.ExceptionDetail' message has been created and by who? The service that the port calls do return HTTP 202 return code and has successfully saved the received message, the service do not return any soap exception. 

Please I appreciates all ideas.




xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'AMRForDMS.AMRQueryCurrent(8fecfabe-9d3a-8fde-f582-660051209750)'.
The service instance will remain suspended until administratively resumed or terminated. 
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 3080c288-758e-4cb5-8517-f325d706b9a3
Shape name: SendGeneralLog
ShapeId: e41fa0df-20ca-4149-b2fb-d5df9ec1042e
Exception thrown from: segment 15, progress 12
Inner exception: Type 'System.ServiceModel.ExceptionDetail' in Assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
        
Exception type: SerializationException
Source: mscorlib
Target Site: System.Reflection.MemberInfo[] InternalGetSerializableMembers(System.RuntimeType)
The following is a stack trace that identifies the location where the exception occured

   at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
   at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
   at Microsoft.XLANGs.Core.ObjectSerializer._serialize(Object graph, StringLookup sl)
   at Microsoft.XLANGs.Core.ObjectSerializer.SerializeStateManager(IStateManager stateMgr, StringLookup lookup)
   at Microsoft.XLANGs.Core.Service.Persist(Boolean dehydrate, Context ctx, Boolean idleRequired, Boolean finalPersist, Boolean bypassCommit, Boolean terminate)
   at Microsoft.XLANGs.Core.LongRunningTransaction.PendingCommit(Boolean ignore, XMessage msg)
   at Microsoft.XLANGs.Core.ExceptionHandlingContext.PendingCommit(Boolean ignoreCommit, XMessage msg)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.SendMessage(Int32 iOperation, XLANGMessage msg, Correlation[] initCorrelations, Correlation[] followCorrelations, Context cxt, Segment seg, ActivityFlags flags)
   at AMRForDMS.AMRQueryCurrent.segment15(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)