We have two NServiceBus endpoints on different version, both with XML serialization.
When the older one tries to send messages to the newer one, for example:
<?xml version="1.0" ?>
<Messages
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://tempuri.net/****.Marketplace.Common.Interfaces.Entities"
xmlns:baseType="****.Marketplace.Common.Interfaces.Entities.MarketplaceAuditRecordBase"
xmlns:baseType1="Harmony.Core.Messages.AuditRecordBase"
xmlns:baseType2="Harmony.Core.Messages.IAuditRecord">
<AuditRecord>
<Id>0</Id>
<BoutiqueUrlName></BoutiqueUrlName>
<BoutiqueId>5301a9f1-d5bd-45c1-8b4f-29b60ed5d8c5</BoutiqueId>
<UserId>null</UserId>
<Success>true</Success>
<EventDateUtc>2018-07-02T14:35:03.1815550</EventDateUtc>
<UserAgent>Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36</UserAgent>
<Url>http://marketplace.****.com/my/items/publish?productId=4181660</Url>
<CountryCode>GB</CountryCode>
<RequestId>4f6b42fa-4c27-4118-bb68-1e314d7a246e</RequestId>
<Application>Site</Application>
<EventCategory>Products</EventCategory>
<EventType>Product-State-Change</EventType>
<EventMessage>Product state changed from Unpublished to Live ()</EventMessage>
<ReferenceId>4181660</ReferenceId>
<SecondaryReferenceId>Live</SecondaryReferenceId>
</AuditRecord>
</Messages>
The receiving endpoint fails with the message:
NServiceBus.MessageDeserializationException: An error occurred while attempting to extract logical messages from transport
---> System.Xml.XmlException: There are multiple root elements . Line 4, position 2.
As far as I can tell these messages are supposed to be backwards-compatible, and the XML in the message is well-formed and causes no problems if I try to parse it with XElement.Load
or new XmlDocument().LoadXml(xml)
.
Can anyone point me in the right direction as to what's wrong?
I can't see any options on the XML serializer to play with and Googling this issue turned up pretty much bupkis.