A
A
Andrey2017-03-29 19:20:35
1C
Andrey, 2017-03-29 19:20:35

How to send data via HTTP using the "Exchange Plan"?

It is necessary to develop a solution for sending a series of data from 1C to an external system, which will be collected using the "Exchange Plan". There seem to be a lot of manuals on this subject, but I did not find a single one that would explain how to form a data packet and send it via HTTP.
At the moment, I see approximately the following sequence of actions:
1. Set up "Auto-registration" of changes for the required "References" in the "Exchange Plan";
2. Add a new node to the "Exchange Plan", which will be an external site;
3. When a new message appears in the "Exchange Plan", form a data package in the form required by the external system;
4. Send data via HTTP, wait for the response and mark the packet as successfully sent.

  • is the scheme described above correct, or in 1C it should look somehow different (I don’t understand this platform at all)
  • How can I track that there is new data to send to the node?
  • is XDTO suitable for forming a message that will be sent to an external system

If there are any better ways to implement such functionality, I'll be happy to hear them.
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kinash, 2017-03-29
@a_ovchinnikov

If there are any better ways to implement such functionality, I'll be happy to hear them.

How many people - so many opinions.
1) There are inaccuracies in your understanding of how the platform works. If on the fingers, then in fact everything looks like this. During auto-registration or when registering programmatically according to the algorithms, nothing happens in the node table. In fact, the "Changes" tables, which are subordinate to the registered objects, are being filled. These tables can even be accessed by queries. For example, for warehouses, the query table will look like Reference.Warehouses.Changes . These tables consist of three columns - a link to the original registered object, a link to the node where we are registering and the package number. Immediately after registration, the package number is not filled in and is filled in with a specific number only at the time the data package is generated for sending. You still have to read more about working with the plan in the documentation.
2) By periodically calling the Exchange Plans.SelectChanges() method. It returns a selection of objects already registered for dispatch. More details in the help.
3) If you need to generate an XML file, the structure of which has strict requirements, which it is desirable to immediately check for compliance with the schema, then yes. If you just need to create an XML file (or better yet, JSON), then simply create the object you need in memory from arrays, structures, and correspondences and then serialize it into the format you need using the WriteXML() or WriteJSON() functions.

K
Konstantin, 2017-03-30
@fosihas

Look here, there is one of the sections just about exchanges)
https://its.1c.ru/db/pubintromobile

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question