Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > Exchange Plan Between Different Configurations

Forum

Search UsersRules
Exchange Plan Between Different Configurations
#1
Interested
Points:: 0
Joined:: Apr 5, 2012

Hi.

I have two a little different configurations (why a little, in both configurations exist catalog Items, but the attribues are different. in both configurations exist document Customer Orders, but the attributes are different).

Between them configured exchange plan within Web-Service. In first configuration save the XML of exchange plan to Value Storage and send it via Web-Service.

But in second configuration at moment reading XML I get the error as:

Quote
Error calling context method (ReadXML)
Data = ReadXML(XMLReader);
because:
Error transforming XML dat a: [19,38]

The code in second configuration is:

Code
StringXML = XMLVAlueStorage.Değer.Get();

XMLReader = New XMLReader;
XMLReader.SetString(StringXML);

MessageReader = ExchangePlans.CreateMessageReader();
MessageReader.BeginRead(XMLReader);
ExchangePlans.DeleteChangeRecords(MessageReader.Sender,MessageReader.ReceivedNo);

BeginTransaction();

While CanReadXML(XMLReader) Do 
   
   Data = ReadXML(XMLReader);
   
   If Not Data = Undefined Then
      
      Data.DataExchange.Sender = MessageReader.Sender;
      Data.DataExchange.Load = True;
      
      Data.Write();
      
   EndIf; 
   
EndDo;
CommitTransaction();

MessageReader.EndRead();
XMLReader.Close();


When calling method ReadXML(XMLReader) which is startes reading as exchange plan I get error.

But when I debug it, while exchange plan starts reading, it can recognize the type of value (for example, XMLReader.LocalName = "CatalogObject.Items"). But at moment converting the the XML value to DATA it gives me the error. I think it is related with the difference of attributes? Isn't it?

So, any examples for exchange plan works between different configurations?

Profile
#2
Interested
Points:: 0
Joined:: Apr 5, 2012

For information, the XML string is given below:

Code
<?xml version="1.0" encoding="UTF-8"?>
<v8msg:Message xmlns:v8msg="http://v8.1c.ru/messages">
   <v8msg:Header>
      <v8msg:ExchangePlan>MobilUygulama</v8msg:ExchangePlan>
      <v8msg:To>001</v8msg:To>
      <v8msg:From>002</v8msg:From>
      <v8msg:MessageNo>4</v8msg:MessageNo>
      <v8msg:ReceivedNo>0</v8msg:ReceivedNo>
   </v8msg:Header>
   <v8msg:Body xmlns:v8="http://v8.1c.ru/data" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <CatalogObject.CariHesaplar>
         <Ref>4852787c-cd72-11e2-a10f-e811321db116</Ref>
         <DeletionMark>false</DeletionMark>
         <Code>000000001</Code>
         <Description>Deneme Cari Hesap</Description>
      </CatalogObject.CariHesaplar>
      <DocumentObject.AlınanSipariş>
         <Ref>4852787f-cd72-11e2-a10f-e811321db116</Ref>
         <DeletionMark>false</DeletionMark>
         <Date>2013-06-05T02:56:13</Date>
         <Number>000000001</Number>
         <Posted>true</Posted>
         <CariHesap>4852787c-cd72-11e2-a10f-e811321db116</CariHesap>
         <Depo>4852787d-cd72-11e2-a10f-e811321db116</Depo>
         <Sorumlu>00000000-0000-0000-0000-000000000000</Sorumlu>
         <MalzemeTablosu>
            <Row>
               <Malzeme>4852787e-cd72-11e2-a10f-e811321db116</Malzeme>
               <Miktar>10</Miktar>
               <Fiyat>10</Fiyat>
               <Tutar>10</Tutar>
            </Row>
         </MalzemeTablosu>
      </DocumentObject.AlınanSipariş>
      <DocumentObject.AlınanSipariş>
         <Ref>f103ca1d-cdc3-11e2-91c1-e811321db116</Ref>
         <DeletionMark>false</DeletionMark>
         <Date>2013-06-05T12:40:23</Date>
         <Number>000000002</Number>
         <Posted>true</Posted>
         <CariHesap>4852787c-cd72-11e2-a10f-e811321db116</CariHesap>
         <Depo>4852787d-cd72-11e2-a10f-e811321db116</Depo>
         <Sorumlu>00000000-0000-0000-0000-000000000000</Sorumlu>
         <MalzemeTablosu>
            <Row>
               <Malzeme>4852787e-cd72-11e2-a10f-e811321db116</Malzeme>
               <Miktar>10</Miktar>
               <Fiyat>10</Fiyat>
               <Tutar>10</Tutar>
            </Row>
         </MalzemeTablosu>
      </DocumentObject.AlınanSipariş>
   </v8msg:Body>
</v8msg:Message>

Profile
#3
Guest
Points::
Joined::

That is because you need to convert data before importing it - the schema is different.

Profile
#4
Interested
Points:: 0
Joined:: Apr 5, 2012

the configurations are different that why the schema will be different.

So about the convertion of data is there any little examples?

Profile
#5
Guest
Points::
Joined::

I'm afraid not yet, but you can generate XMLs by using export of data from both databases, compare them and see the difference in XML structure. After that you could write a converter by parsing the source XML into a tree, replace names of some branches that are different, remove unnecessary and add required brances, then save the resulting XML file and use it for import in second infobase.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.