Monday, July 14, 2014

XTransformationFailureException.. or Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added.

I just met this fine error after a migration of BizTalk2006 maps to 2013. It is strictly connected to the use of XslCompiledTransform which is now used since BizTalk 2013.

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



Wednesday, July 9, 2014

BizTalk XmlException: "'Text' is an invalid XmlNodeType. Line 1, position 1"

If you run into this error during runtime:

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}

... then your WCF Send Port Configuration might have screwed up. You can verify this, if the "Send Port Configuration Wizard" breaks with this error when you press the "Edit Endpoint Identity" button or when you try to export the configuration. The Endpoint Identity itself shows some sort of stars:


Solution (July 7, 2014): I imported the binding files with <Password vt="1">pwd<Password><Identity vt="1" />. Since vt contains the type (and format) of the element, it got somehow puzzled. So either use vt="8" or just remove the <Identity> element if you do not need it.

However, the same error can occur also with other mistakes in the Custom props, for example wrong passwords or escaping errors (for example, a non-escaped ">"). Thanks, Christian, for the information!

Tuesday, July 1, 2014

Biztalk/VS Error Message "non-readonly field property access is limited to distinguished fields on class-based messages"

Do you run into the following error while building your Biztalk project?
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.

Mahesh explained this error on MSDN - it comes from the installation of Hotfix 2851429 in CU2. According to Microsoft, it will be fixed with CU3; if you do not want to wait, you should contact Microsoft Support.

Until then, the only solution that helped me was to un-install the CU2.

Here the screenshot of the error:

UPDATE on July 8th, 2014: The issue is solved in BizTalk 2013 R2.