An error occurred while parsing EntityName. Line1, position 581

Recently I ran into this error for couple of times.

image.png

Both the times this issue was due to the ‘&’ character in the address field of the XML message being processed in BizTalk.

‘&’ is basically an invalid XML character along with following and should be replaced / encoded before using them in XML.

image

There is better / nicer way of achieving the same outcome by using SecurityElement.Escape method under System.Security namespace in .NET 4.5 and above.

image

Here Escape method will replace “&” with “&”. This method basically replaces invalid XML characters in a string with their valid XML equivalent.

So its always better to use this method while processing the address or other fields from XML message where the content of the field may contain invalid XML characters.

 Related links:

https://social.msdn.microsoft.com/Forums/en-US/c1c6b604-150c-4e0d-8b49-e2b4a1407c19/orchestration-xml-exception?forum=biztalkgeneral

http://stackoverflow.com/questions/7844410/escaping-only-contents-of-node-in-xml

Loved this? Spread the word


BizTalk Server Monitoring

Gautam

Follow me here

About the Author

My name is Gyanendra Kumar Gautam. I am Solution Consultant, who basically works to hook the stuff together using Microsoft technologies like Azure PaaS, Azure Serverless Services, Microsoft BizTalk Server, and Azure DevOps Services.

You may also like

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
turbo360

Never miss a good story!

 Subscribe to my blog to keep up with the latest news!