In my case it occurred whenever an depended father field was filled with NIL.
See the example here:
Quick solution was removing the NIL value and just apply the boolean value to the father element
Random pitfalls (and their solutions) in EAI technologies such as BizTalk
A message sent to adapter "WCF-Custom" on send port "SapInvoiceExport" with URI "sap://CLIENT=007;LANG=EN;@a/SAP-SERVER/00?GWSERV=sapgw00&RfcSdkTrace=False&AbapDebug=False" is suspended.
Error details: System.Xml.XmlException: 'Text' is an invalid XmlNodeType. Line 1, position 1.
at System.Xml.XmlReader.ReadStartElement(String name)
at Microsoft.BizTalk.Adapter.Wcf.ComponentModel.IdentityElementSurrogate.ReadXml(XmlReader reader)
at Microsoft.BizTalk.Adapter.Wcf.ComponentModel.IdentityElementSurrogate.set_ConfigXml(String value)
at Microsoft.BizTalk.Adapter.Wcf.Config.CustomTLConfig.CreateEndpointAddress()
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.InitializeValues(IBaseMessage message)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfTransmitter`2.GetClientFromCache(String spid, IBaseMessage message)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfAsyncBatch`2.BatchWorker(List`1 messages)
MessageId: {E62F2F57-1727-40A7-81DC-8DF797250933}
InstanceID: {E59F2C86-D2A7-4A57-B6B0-7C3995676E3A}
Non-readonly field property access is limited to distinguished fields on class-based messages.Visual Studio seems to misinterpret your property access to the XmlDocument message, for example with MSG.DocumentElement.LocalName. It assumes that you want to access a distinguished field, which is not allowed here.