Attachment entity without body tag - dynamic

Issue : I am using email attachment entity to receive email with attachments.
Our environment is - D365. When Email is sent using outlook or d365 as well, the attachment entity is without body tag
Steps to reproduce
Create attachment locally (can be any extension or encoding)
Send email either to account synced with D365 or use D365 to send email to same along with attachment.
query email with attachments and also get body tag
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
<entity name="email" >
<attribute name="modifiedon" />
<attribute name="sender" />
<order attribute="modifiedon" descending="false" />
<filter>
<condition attribute="modifiedon" operator="on-or-after" value="2020-03-25" />
</filter>
<link-entity name="activitymimeattachment" from="objectid" to="activityid" link-type="inner" alias="ak" >
<attribute name="filename" />
<attribute name="body" />
</link-entity>
</entity>
</fetch>
o Expected output.
<resultset morerecords="0">
<result>
<modifiedon date="3/27/2020" time="3:08 PM">2020-03-27T15:08:54+05:30</modifiedon>
<sender> xyz#abc.com</sender>
<ak.filename>test-20181009T133141.xml</ak.filename>
<ak.body>VGhlIFVSTCBzaG91bGQgYmUgY29udmVydGVkIHRvIEJhc2U2NA==</ak.body>
</result>
</resultset>
•
o Received output.
<resultset morerecords="0">
<result>
<modifiedon date="3/27/2020" time="4:04 PM">2020-03-27T16:04:24+05:30</modifiedon>
<sender>xyz#abc.com</sender>
<ak.filename>test-2019-04-17T200954.660.xml</ak.filename>
</result>
<result>
<modifiedon date="3/27/2020" time="4:12 PM">2020-03-27T16:12:15+05:30</modifiedon>
<sender> xyz#abc.com</sender>
<ak.filename>image002.jpg</ak.filename>
</result>
<result>
<modifiedon date="3/27/2020" time="4:12 PM">2020-03-27T16:12:15+05:30</modifiedon>
<sender> xyz#abc.com</sender>
<ak.filename>image004.jpg</ak.filename>
</result>
<result>
<modifiedon date="3/27/2020" time="4:12 PM">2020-03-27T16:12:15+05:30</modifiedon>
<sender> xyz#abc.com</sender>
<ak.filename>image006.jpg</ak.filename>
</result>
</resultset>
Please help us in finding the root cause of this issue.

You have to remove distinct="true" form your fetchxml and then it shall work.
Try below fetchxml
<fetch version="1.0" output-format="xml-platform" mapping="logical" >
<entity name="email" >
<attribute name="modifiedon" />
<attribute name="sender" />
<order attribute="modifiedon" descending="false" />
<filter>
<condition attribute="modifiedon" operator="on-or-after" value="2020-03-25" />
</filter>
<link-entity name="activitymimeattachment" from="objectid" to="activityid" link-type="inner" alias="ak" >
<attribute name="filename" />
<attribute name="body" />
</link-entity>
</entity>
</fetch>

Related

Inner join is breaking SSRS

I have a query:
SELECT systemuser.fullname AS 'fullname',
usersettings.calendartype AS 'calendartype',
usersettings.uilanguageid AS 'uilanguageid'
FROM filteredsystemuser AS systemuser
INNER JOIN filteredusersettings AS usersettings
ON systemuser.systemuserid = usersettings.systemuserid
inner join vfinduserguid vfg
on systemuser.systemuserid = vfg.userguid
which I have converted to FetchXML:
<fetch mapping="logical">
<entity name="systemuser">
<attribute name="fullname" alias="fullname" />
<link-entity name="usersettings" to="systemuserid" from="systemuserid" alias="usersettings" link-type="inner">
<attribute name="calendartype" alias="calendartype" />
<attribute name="uilanguageid" alias="uilanguageid" />
<link-entity name="vfinduserguid" to="systemuserid" from="userguid" alias="vfg" link-type="inner" />
</link-entity>
</entity>
</fetch>
using this service: http://www.sql2fetchxml.com/
When I try to use this FEtchXML within SSRS, I'm getting:
The specific record type does not exist in Microsoft Dynamics CRM.
What am I doing wrong?
Please note that it is the last join (vfinduserguid) that is breaking it. This object is a view.
Here is fetch to get the current user:
<fetch version="1.0" output-format="xml-platform"
mapping="logical" distinct="false">
<entity name="systemuser">
<attribute name="fullname" />
<attribute name="systemuserid" />
<order attribute="fullname" descending="false" />
<filter type="and">
<condition attribute="systemuserid"
operator="eq-userid" />
</filter>
</entity>
</fetch>
http://crmtipoftheday.com/2014/01/09/reflecting-current-user-ssrs/

Mule - CSV Lookup Table

I have a mule flow with DataMapper configuration to map XML to JSON, in that I have a requirement to Lookup a CSV file which contains, for example, two columns and four rows to map to one of the JSON output field.
Below are my sample CSV file contents:
Name,Contact
Ram,111-222
Kumar,222-333
John,333-444
I got below exception while running DataMapper:
Element [CSV:CSV]-Pre-Execution of lookup table [CSV:CSV]failed
Error when parsing record #2 field Name
Caused by: java.lang.RuntimeException: Parsing error: Unexpected record delimiter, probably record has too few fields.
When the CSV file contains only one row there is no exception.
Could any one provide me a way to solve the issue? Thanks in advance.
EDIT: Please find the DataMapper configuration
<mule>
<data-mapper:config name="XML_To_JSON_1" transformationGraphPath="xml_to_json_1.grf" doc:name="XML_To_JSON" />
<flow name="mule-csv-lookupFlow1" doc:name="mule-csv-lookupFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="9090" doc:name="HTTP" />
<data-mapper:transform config-ref="XML_To_JSON_1" doc:name="XML To JSON" />
</flow>
</mule>
Below is the .grf file
<?xml version="1.0" encoding="UTF-8"?><Graph __version="3.5.0" author="pradeep" created="Wed Dec 03 13:06:48 IST 2014" description="XML To JSON" guiVersion="3.4.4.P" id="1417593604462" licenseCode="Unlicensed" licenseType="Unknown" modified="Wed Dec 03 13:06:48 IST 2014" modifiedBy="pradeep" name="XML_To_JSON" preview-file="${Project_Home}/src/main/resources/employee.xml" revision="1.0" showComponentDetails="false">
<Global>
<Metadata __index="0" __referenceCounter="1" __sourcePath="{}/object/contact" _dataStructure="SINGLE_DIMENSIONAL_COLLECTION" _id="__id" _metadataParentId="4430d2fe-5b06-4e39-b259-492c325fe164" _parent_id="__parent_id" _type="Output" id="f11ab87d-ec49-4034-a277-1e96a57b7925">
<Record fieldDelimiter="," name="contact" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_parent_id" __systemManaged="true" name="__parent_id" type="string"/>
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
<Field __index="0" __sourcePath="{}/object/contact/name" containerType="SINGLE" label="name" name="name" type="string"/>
<Field __index="1" __sourcePath="{}/object/contact/phone" containerType="SINGLE" label="phone" name="phone" type="string"/>
</Record>
</Metadata>
<Metadata _type="Lookup" id="963db4af-a7a1-428c-be6b-39af261e93d4">
<Record fieldDelimiter="," name="CSV" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field containerType="SINGLE" label="firstname" name="firstname" size="10" type="string"/>
<Field containerType="SINGLE" eofAsDelimiter="true" label="phone" name="phone" size="10" type="string"/>
</Record>
</Metadata>
<Metadata __index="0" __referenceCounter="1" __schemaType="employeeType" __sourcePath="{}/employees/employee" _dataStructure="SINGLE_DIMENSIONAL_COLLECTION" _id="__id" _metadataParentId="80f1c157-e81d-439d-afa8-e475de2dfe36" _parent_id="__parent_id" _type="Input" id="019cda9c-1078-4d00-bdcc-f81a59df5292">
<Record fieldDelimiter="," name="employee" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_parent_id" __systemManaged="true" name="__parent_id" type="string"/>
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
<Field __index="0" __schemaType="employeeType" __sourcePath="{}/employees/employee/#firstname" containerType="SINGLE" label="firstname" name="firstname" type="string"/>
<Field __index="1" __schemaType="employeeType" __sourcePath="{}/employees/employee/#lastname" containerType="SINGLE" label="lastname" name="lastname" type="string"/>
<Field __index="2" __schemaType="employeeType" __sourcePath="{}/employees/employee/#gender" containerType="SINGLE" label="gender" name="gender" type="string"/>
<Field __index="3" __schemaType="employeeType" __sourcePath="{}/employees/employee/#phone" containerType="SINGLE" label="phone" name="phone" type="string"/>
<Field __index="4" __schemaType="employeeType" __sourcePath="{}/employees/employee/#text()" containerType="SINGLE" label="text()" name="text" type="string"/>
</Record>
</Metadata>
<Metadata __filteredMetadata="false" __index="0" __referenceCounter="1" __schemaType="employeesType" __sourcePath="{}/employees" _dataStructure="OBJECT" _id="__id" _type="Input" id="80f1c157-e81d-439d-afa8-e475de2dfe36">
<Record fieldDelimiter="," name="employees" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
</Record>
</Metadata>
<Metadata __index="0" __referenceCounter="1" __sourcePath="{}/object" _dataStructure="OBJECT" _id="__id" _type="Output" id="4430d2fe-5b06-4e39-b259-492c325fe164">
<Record fieldDelimiter="," name="object" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
</Record>
</Metadata>
<LookupTable fileURL="D:/1_Ram/DEV/Workspace/mule-workspace/mule-datamapper-lookup/src/main/resources/staff.txt" id="CSV" key="phone" metadata="963db4af-a7a1-428c-be6b-39af261e93d4" name="CSV" type="simpleLookup">
<attr name="lookupType"><![CDATA[CSV]]></attr>
</LookupTable>
<Dictionary>
<Entry id="DictionaryEntry0" input="true" name="inputPayload" output="false" type="object"/>
<Entry id="DictionaryEntry1" input="false" name="outputPayload" output="true" type="object"/>
</Dictionary>
</Global>
<Phase number="0">
<Node enabled="enabled" guiName="Foreach 'employees' -> 'object'" guiX="460" guiY="20" id="FOREACH_EMPLOYEES_OBJECT" transformClass="com.mulesoft.datamapper.transform.MelRecordTransform" type="REFORMAT">
<attr name="melScript"><![CDATA[//MEL
//START -> DO NOT REMOVE
output.__id = input.__id;
//END -> DO NOT REMOVE
]]></attr>
</Node>
<Node enabled="enabled" guiName="Foreach 'employee' -> 'contact'" guiX="460" guiY="120" id="FOREACH_EMPLOYEE_CONTACT" transformClass="com.mulesoft.datamapper.transform.MelRecordTransform" type="REFORMAT">
<attr name="melScript"><![CDATA[//MEL
//START -> DO NOT REMOVE
output.__id = input.__id;
output.__parent_id = input.__parent_id;
//END -> DO NOT REMOVE
output.phone = input.phone + (isnull(lookup("CSV").get([input.firstname])) ? null : lookup("CSV").get([input.firstname]).phone);
output.name = input.lastname + ' ' + input.firstname;]]></attr>
</Node>
<Node cacheInMemory="true" charset="UTF-8" enabled="enabled" fileURL="dict:outputPayload" guiName="JSON WRITER" guiX="900" guiY="20" id="JSON_WRITER0" type="JSON_WRITER">
<attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<object xmlns:clover="http://www.cloveretl.com/ns/xmlmapping" clover:inPort="0">
<clover:collection clover:name="contact">
<item clover:inPort="1" clover:key="__parent_id" clover:parentKey="__id">
<name>$1.name</name>
<phone>$1.phone</phone>
</item>
</clover:collection>
</object>]]></attr>
<attr name="__isJsonSchema"><![CDATA[false]]></attr>
<attr name="_data_format"><![CDATA[JSON]]></attr>
<attr name="jsonSchemaURL"><![CDATA[./src/main/resources/contacts.json]]></attr>
</Node>
<Node charset="UTF-8" dataPolicy="strict" enabled="enabled" fileURL="dict:inputPayload" guiName="XML READER" guiX="20" guiY="20" id="XML_READER0" type="XML_READER">
<attr name="xmlSchemaURL"><![CDATA[./src/main/resources/employees.xsd]]></attr>
<attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Context outPort="0" sequenceField="__id" xpath="/employees">
<Context generatedKey="__parent_id" outPort="1" parentKey="__id" sequenceField="__id" xpath="employee">
<Mapping cloverField="firstname" trim="true" xpath="#firstname"/>
<Mapping cloverField="lastname" trim="true" xpath="#lastname"/>
<Mapping cloverField="gender" trim="true" xpath="#gender"/>
<Mapping cloverField="phone" trim="true" xpath="#phone"/>
<Mapping cloverField="text" trim="true" xpath="text()"/>
</Context>
</Context>
]]></attr>
<attr name="_data_format"><![CDATA[XML]]></attr>
<attr name="__rootGlobalElementName"><![CDATA[employees]]></attr>
</Node>
<Edge debugMode="true" fromNode="FOREACH_EMPLOYEES_OBJECT:0" guiBendpoints="" id="Edge1" inPort="Port 0 (in)" metadata="4430d2fe-5b06-4e39-b259-492c325fe164" outPort="Port 0 (out)" toNode="JSON_WRITER0:0"/>
<Edge debugMode="true" fromNode="FOREACH_EMPLOYEE_CONTACT:0" guiBendpoints="" id="Edge3" inPort="Port 1 (in)" metadata="f11ab87d-ec49-4034-a277-1e96a57b7925" outPort="Port 0 (out)" toNode="JSON_WRITER0:1"/>
<Edge debugMode="true" fromNode="XML_READER0:0" guiBendpoints="" id="Edge0" inPort="Port 0 (in)" metadata="80f1c157-e81d-439d-afa8-e475de2dfe36" outPort="Port 0 (out)" toNode="FOREACH_EMPLOYEES_OBJECT:0"/>
<Edge debugMode="true" fromNode="XML_READER0:1" guiBendpoints="" id="Edge2" inPort="Port 0 (in)" metadata="019cda9c-1078-4d00-bdcc-f81a59df5292" outPort="Port 1 (out)" toNode="FOREACH_EMPLOYEE_CONTACT:0"/>
</Phase>
</Graph>
I noticed the following issues in your .grf file:
1. CSV Record fields are firstname and phone while in your actual csv file they are Name and Contact (I assume the CSV sample in your original post matches what in staff.txt file).
2. LookupTable key is phone while you lookup based on name in your phone mapping lookup("CSV").get([input.firstname]).phone

CRM 2011 Custom SQL based report error after change default filters

I have some report in SQL (with pre-filtering).
I import this report to CRM (Dynamics CRM 2011) and run - everything is ok.
But when I changed default filter for this report in CRM and save - report is not run anymore (report error).
I download and checked this two files (before change default filters and after change that) and problem is that when I changed filters, crm insert into link-entity (xml 'join' node) some alias which is GUID. When I change this alias (in rdl file) from GUID to 'ab' for example and reimport this report to CRM, it is work again - until someone change default filter...
So what I shold to do ? Because now it is impossible to give users possibility to change default filter for report in CRM.
edit:
Mostly whole xml for .rdl file is the same for both reports. Only difference is in CustomProperty node. In this node is definition for defualt filter.
Section from work report width default filters without any changes:
<CustomProperty>
<Name>Custom</Name>
<Value>
<MSCRM xmlns="mscrm">
<ReportFilter>
<ReportEntity paramname="P1">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="sc_accountevents">
<all-attributes />
<filter type="and">
<condition attribute="modifiedon" operator="last-x-days" value="30" />
</filter>
</entity>
</fetch>
</ReportEntity>
<ReportEntity paramname="P2">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="businessunit">
<all-attributes />
<filter type="and">
<condition attribute="modifiedon" operator="last-x-days" value="30" />
</filter>
</entity>
</fetch>
</ReportEntity>
<ReportEntity paramname="P3">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="account">
<all-attributes />
<filter type="and">
<condition attribute="modifiedon" operator="last-x-days" value="30" />
</filter>
</entity>
</fetch>
</ReportEntity>
</ReportFilter>
</MSCRM>
</Value>
</CustomProperty>
Section from broken report (after change default filters):
<CustomProperty>
<Name>Custom</Name>
<Value>
<MSCRM xmlns="mscrm">
<ReportFilter>
<ReportEntity paramname="P1" displayname="Account Events">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="sc_accountevents">
<all-attributes />
<link-entity name="account" from="accountid" to="sc_klientid" visible="false" link-type="outer" alias="a_58cc568ca7ece311896000155d68d9dc">
<attribute name="sc_jednostkabiznesowaid"/>
</link-entity>
<link-entity name="systemuser" from="systemuserid" to="owninguser" alias="ae">
<filter type="and">
<condition attribute="businessunitid" operator="eq-businessid"/>
</filter>
</link-entity>
</entity>
</fetch>
</ReportEntity>
<ReportEntity paramname="P2" displayname="Jednostki biznesowe">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="businessunit">
<all-attributes />
</entity>
</fetch>
</ReportEntity>
<ReportEntity paramname="P3" displayname="Klienci">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="account">
<all-attributes />
</entity>
</fetch>
</ReportEntity>
</ReportFilter>
</MSCRM>
</Value>
</CustomProperty>
And again work report with changed default filters but with edit alias in link-entity node:
<CustomProperty>
<Name>Custom</Name>
<Value>
<MSCRM xmlns="mscrm">
<ReportFilter>
<ReportEntity paramname="P1" displayname="Account Events">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="sc_accountevents">
<all-attributes />
<link-entity name="account" from="accountid" to="sc_klientid" visible="false" link-type="outer" alias="ab">
<attribute name="sc_jednostkabiznesowaid"/>
</link-entity>
<link-entity name="systemuser" from="systemuserid" to="owninguser" alias="ae">
<filter type="and">
<condition attribute="businessunitid" operator="eq-businessid"/>
</filter>
</link-entity>
</entity>
</fetch>
</ReportEntity>
<ReportEntity paramname="P2" displayname="Jednostki biznesowe">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="businessunit">
<all-attributes />
</entity>
</fetch>
</ReportEntity>
<ReportEntity paramname="P3" displayname="Klienci">
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="account">
<all-attributes />
</entity>
</fetch>
</ReportEntity>
</ReportFilter>
</MSCRM>
</Value>
</CustomProperty>
Ok.
Probably no way to do something with this.
It's a bug which is remove in rollup 17 (2 months ago)...

VersionOne rest API description attribute format

Successfully using the VersionOne API to create stories using the REST API. Unfortunately the description field seems to strip all xml tags. (The example online uses , but this does not work)
So have something like:
POST /VersionOne/rest-1.v1/Data/Story HTTP/1.1
Content-Type: text/xml; charset=utf-8
Content-Length: 221
<Asset>
<Attribute name="Name" act="set">New Story</Attribute>
<Relation name="Scope" act="set">
<Asset idref="Scope:0" />
</Relation>
<Attribute name="Description" act="set">
<p>first line</p>
<p> second line</p>
</Attribute>
</Asset>
Any way to insert formatting? Basically we are using this as a story to test our recently created artifact and want to refer to the defects/stories that are included in the artifact. Any help much appreciated, thanks.
Jon, you'll need to XML-encode the text value of Description. Two possibilities are:
<Asset>
<Attribute name="Name" act="set">New Story</Attribute>
<Relation name="Scope" act="set">
<Asset idref="Scope:0" />
</Relation>
<Attribute name="Description" act="set">
<p>first line</p>
<p> second line</p>
</Attribute>
</Asset>
or
<Asset>
<Attribute name="Name" act="set">New Story</Attribute>
<Relation name="Scope" act="set">
<Asset idref="Scope:0" />
</Relation>
<Attribute name="Description" act="set"><![CDATA[
<p>first line</p>
<p> second line</p>
]]></Attribute>
</Asset>
You could try to use CDATA sections, like this:
<Asset>
<Attribute name="Description" act="set">
<![CDATA[
<xml>code goes here</xml>
]]>
</Attribute>
</Asset>
When I do this against our public test server: https://www14.v1host.com/v1sdktesting/http.html, and POST to the default Scope/0, I get this:
<?xml version="1.0" encoding="UTF-8"?>
<Asset href="/v1sdktesting/rest-1.v1/Data/Scope/0/21470" id="Scope:0:21470">
<Attribute name="Description"><xml>code goes here</xml> </Attribute>
</Asset>
Does this help?

sp_xml_preparedocument go with error "Only one top level element is allowed in an XML document"

I'am trying to execute sp_xml_preparedocument and geting error "Only one top level element is allowed in an XML document"
my T-SQL commands:
DECLARE #aa XML
DECLARE #idoc int
SET #aa =(select * from db_name for xml auto, xmldata)
#aa now is
<Schema xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes" name="Schema7">
<ElementType name="Person" content="empty" model="closed">
<AttributeType name="preson_id" dt:type="i4" />
<AttributeType name="Name" dt:type="string" />
<AttributeType name="Surname" dt:type="string" />
<AttributeType name="guid" dt:type="uuid" />
<AttributeType name="version" dt:type="bin.base64" />
<attribute type="preson_id" />
<attribute type="Name" />
<attribute type="Surname" />
<attribute type="guid" />
<attribute type="version" />
</ElementType>
</Schema>
<Person xmlns="x-schema:#Schema7" preson_id="1" Name="Иван" Surname="Иванов" guid="2E739E87-3CA4-4ED8-ADD0-8B59957668B8" version="AAAAAAAAB9E=" />
<Person xmlns="x-schema:#Schema7" preson_id="2" Name="Николай" Surname="Николаев" guid="BDC41C59-D70F-4B70-954E-4918B9516AF8" version="AAAAAAAAB9I=" />
<Person xmlns="x-schema:#Schema7" preson_id="3" Name="Максим" Surname="Максимов" guid="740E57F3-56BA-48B8-92AF-978D7B1D2712" version="AAAAAAAAB9M=" />
EXEC sp_xml_preparedocument #idoc OUTPUT, #aa
The XML parse error 0xc00ce555 occurred on line number 1, near the XML text ""
Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocument, Line 1
The error description is 'Only one top level element is allowed in an XML document
I'am new in this, and i need help)))
An one more question - How parse timestamp type?
if i use
SET #aa =(select * from db_name for xml elements, root('root'), type)
sp_xml_preparedocument works fine, OPENXML returns all values of my db_table, but timestamp values looks not the same as were..
Sorry for my bad English
SELECT #aa returns
<Schema xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes" name="Schema7">
<ElementType name="Person" content="empty" model="closed">
<AttributeType name="preson_id" dt:type="i4" />
<AttributeType name="Name" dt:type="string" />
<AttributeType name="Surname" dt:type="string" />
<AttributeType name="guid" dt:type="uuid" />
<AttributeType name="version" dt:type="bin.base64" />
<attribute type="preson_id" />
<attribute type="Name" />
<attribute type="Surname" />
<attribute type="guid" />
<attribute type="version" />
</ElementType>
</Schema>
<Person xmlns="x-schema:#Schema7" preson_id="1" Name="Иван" Surname="Иванов" guid="2E739E87-3CA4-4ED8-ADD0-8B59957668B8" version="AAAAAAAAB9E=" />
<Person xmlns="x-schema:#Schema7" preson_id="2" Name="Николай" Surname="Николаев" guid="BDC41C59-D70F-4B70-954E-4918B9516AF8" version="AAAAAAAAB9I=" />
<Person xmlns="x-schema:#Schema7" preson_id="3" Name="Максим" Surname="Максимов" guid="740E57F3-56BA-48B8-92AF-978D7B1D2712" version="AAAAAAAAB9M=" />
An XML document must have one root element only - see W3C specification.
Thus in you case if Schema is the root element you cannot add the Person elements at the end
Make sure that there is no duplicate entries for the record that you are trying to get