1b.app
Link copied -

transfer of special characters in product names from 1s

Есть необходимость консультации по работе с системой?
Вы всегда можете создать топик на нашем форуме и партнеры-интеграторы с радостью вам помогут! Создать топик на форуме
we use your integration module with 1C
we load products into the box from 1C.
there are special characters in product names, for example &
please tell me how to transfer such characters from 1C to 1B so that it does not cause errors.
if you need to adjust the escaping on the 1s side, then how do you properly screen such characters so that boxing distinguishes them?
Original question is available on version: ru

Answers:

Good afternoon. Try to replace "&" with "&" on side 1c when unloading
30.12.2020, 12:23
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

Bodyako Dmitry
Employee wrote:
Good afternoon. Try to replace "&" with "&" on side 1c when unloading

did you by any chance misspeak? structures do not differ.
we tried
\&
&
did not help. product names are not updated, it looks like the script crashes on these designs
30.12.2020, 12:36
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

Bodyako Dmitry
Employee wrote:
Good afternoon. Try to replace "&" with "&" on side 1c when unloading

ahhh. understood. box "eats" part of the message. can you give a screenshot?
construct did not work
30.12.2020, 12:39
Original comment available on version: ru

yep, you need "& amp;" without a space between them. The forum turns this construction into just &, because this construction is also for html
30.12.2020, 12:51
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

Bodyako Dmitry
Employee wrote:
yep, you need "& amp;" without a space between them. The forum turns this construction into just &, because this construction is also for html

understood. construction "& amp;" tried, didn't help. post a bug?
30.12.2020, 13:06
Original comment available on version: ru

try also wrapping the tag values in CDATA , if that doesn't work, we will need to modify the parser on our side so that it can catch CDATA . But it's not a bug)
30.12.2020, 14:23
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

Bodyako Dmitry
Employee wrote:
try also wrapping the tag values in CDATA , if that doesn't work, we will need to modify the parser on our side so that it can catch CDATA . But it's not a bug)

pass in xml an ampersand in escaped form like this
in the log file like this , i.e. square bracket appears
Tell me, is this the norm, why is it displayed in the logs like this?
if you need improvement, then rate it, pliz, and preferably not through the use of CDATA
just in case, I am attaching the source xml file, which is sent to the box from 1s
31.12.2020, 10:38
Original comment available on version: ru

if the specified methods did not work, then you need to parse the value from CDATA. Those. on your part, the value of the tag needs to be wrapped in CDATA, and on our part, parsed accordingly. For one api, it will take 1 hour of refinement.
08.01.2021, 15:59
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

Bilbo Baggins
cracker wrote:
if the specified methods did not work, then you need to parse the value from CDATA. Those. on your part, the value of the tag needs to be wrapped in CDATA, and on our part, parsed accordingly. For one api, it will take 1 hour of refinement.

invoice please!
17.02.2021, 14:26
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

Bilbo Baggins
cracker wrote:
if the specified methods did not work, then you need to parse the value from CDATA. Those. on your part, the value of the tag needs to be wrapped in CDATA, and on our part, parsed accordingly. For one api, it will take 1 hour of refinement.

Will it be implemented only for the product name or for other fields as well?
17.02.2021, 14:30
Original comment available on version: ru


Перегиняк Александр
Oneboxconsulting (интегратор)

Bilbo Baggins
cracker wrote:
for all xml

super! issue an invoice
17.02.2021, 17:37
Original comment available on version: ru

Good afternoon. Added reading from CDATA.
28.10.2021, 16:41
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

anonymous duck
OneBox production
Employee wrote:
Good afternoon. Added reading from CDATA.

will this code generated on the 1c side be valid for processing ?
29.10.2021, 17:20
Original comment available on version: ru

This piece is valid. If the rest of the xml is ok, everything should be ok
01.11.2021, 09:52
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

anonymous duck
OneBox production
Employee wrote:
This piece is valid. If the rest of the xml is ok, everything should be ok

check. does not work yet. On the 1c side, we set up wrapping fields in cdata, set up copying of the file transferred to 1v (see attachment)
it turns out that in the logs it is displayed like this , and in the file itself sent from the server like this . those. it takes an array from somewhere, crashes on that and does not update the data in the product card. please correct or help me figure out what is wrong.
01.11.2021, 14:37
Original comment available on version: ru

Can you give me a complete curl request that you make so that I can test and print on my site right away? The file is unfortunately immediately deleted after processing, it is inconvenient to catch the moment when it exists or even print it in the logs.
01.11.2021, 16:29
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

anonymous duck
OneBox production wrote:
Can you give me a complete curl request that you make so that I can test and print on my site right away? The file is unfortunately immediately deleted after processing, it is inconvenient to catch the moment when it exists or even print it in the logs.

were able to do the following...
created a folder on the server where the file is saved on each upload

tell me where to send access
17.11.2021, 08:30
Original comment available on version: ru

That just drop the whole request that you make to me here in the form of a file. For example:
curl -X 'POST' 'https://xxx/1c/product/set/' -H 'accept: application/json' -d 'file content' . Or just attach the file itself to this topic, I will create a request myself
17.11.2021, 13:04
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

anonymous duck
OneBox production wrote:
That just drop the whole request that you make to me here in the form of a file. For example:
curl -X 'POST' 'https://xxx/1c/product/set/' -H 'accept: application/json' -d 'file content' . Or just attach the file itself to this topic, I will create a request myself
18.11.2021, 10:08
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

anonymous duck
OneBox production wrote:
That just drop the whole request that you make to me here in the form of a file. For example:
curl -X 'POST' 'https://xxx/1c/product/set/' -H 'accept: application/json' -d 'file content' . Or just attach the file itself to this topic, I will create a request myself

I am attaching the file
18.11.2021, 10:09
Original comment available on version: ru

Перегиняк Александр
Oneboxconsulting (интегратор)

anonymous duck
OneBox production wrote:
That just drop the whole request that you make to me here in the form of a file. For example:
curl -X 'POST' 'https://xxx/1c/product/set/' -H 'accept: application/json' -d 'file content' . Or just attach the file itself to this topic, I will create a request myself

file provided. when to expect an answer? the client had an emergency because of this. balances are not updated
23.11.2021, 11:37
Original comment available on version: ru

Good afternoon. Your xml is invalid. You can check this by renaming the file to .xml and opening it in a browser.
29.11.2021, 14:02
Original comment available on version: ru

Good afternoon, the errors have been fixed, now the xml files are valid, there are examples of uploads in txt and xml format in the archive, the full upload still does not work, but the selective one works.
We tested the unloading of individual categories:
1) The categories are definitely NOT uploaded: Promotions, Accessories;
2) Categories are accurately unloaded: Quadcopters, Steadicams, Projectors, Smart watches, Vacuum cleaners, Industrial solutions;
3) It is not known whether the categories work: Services, Robots.
I throw off the archive with examples of uploads, in it:
1) Uploading the category Promotions (not uploaded);
2) Unloading an individual product from the Promotions category (unloaded);
3) Unloading the category Quadcopters (unloading);
4) Unloading all categories (not unloading).
Left the full unloading enabled.
Product for testing, it is in the Accessories category:
30.11.2021, 12:08
Original comment available on version: ru

I can't unpack your archive. please send in another format, zip for example.
30.11.2021, 12:59
Original comment available on version: ru


I don’t see any differences in the files, the tool parses them. Try now to make a request with products that do not pass, I put the logs. Let's see what happens on the server
30.11.2021, 15:01
Original comment available on version: ru

Launched an exchange
30.11.2021, 15:07
Original comment available on version: ru



Stanislav, you are sending invalid xml. It has lines like this
<name_ua><![CDATA[CrystalSky Charging Hub "FR-000345">Sale</category>
Save the file before sending it to yourself and take a look at the product with article number CP.BX.000230 .
30.11.2021, 15:20
Original comment available on version: ru

I checked, the wrong file was sent. Now there is a correct unloading. xml is read. The specified product has the symbol "&" in the name, in xml it looks like this:

Could this cause an error?
30.11.2021, 15:33
Original comment available on version: ru

Stanislav, your new xml and any others that you sent in the last 10 minutes are also invalid. It is very easy to check the validity of a file. You need to save it to yourself and open it in the browser, the browser will show you the place and even the line number of the cant, it will be easy to understand what is wrong there.
30.11.2021, 15:40
Original comment available on version: ru

Here I opened the last upload in chrome, there are no errors indicating the row and column, the file is read by me:
30.11.2021, 15:47
Original comment available on version: ru

Send just this ONE upload to the box now, I'll take a look. Disable other downloads.
30.11.2021, 15:50
Original comment available on version: ru

Unloading occurs automatically, every 10 minutes. Same. To disable it completely, you will have to involve a 1C developer, because these settings are buried outside the user interface. It takes time. Should I have a developer turn off the automation, or can we do the analysis during that 10-minute window between uploads?
30.11.2021, 15:57
Original comment available on version: ru

I looked at the full file that comes to us. It breaks off in the middle:
<product>
<category id="FR-000546">DJI Mini 2 Accessories</category>
<vidceni>RRP PRICE</vidceni>
<barcode>6941565901347</barcode>
<brand>DJI</brand>
<garantiya12>14 days</garantiya12>
CP.MA.00000295.01
FR-0005967
<![CDATA[DJI Mini branded bag (Chorno-Zhovta)]]></name_ua>
<namenovaniedlyapechati36><![CDATA[DJI Mini branded bag (Chorno-Zhovta)]]></namenovaniedlyapechati36>
<vendorname>DJI Mini Bag (Black Array)
accordingly, xml cannot be processed, due to the fact that it is torn off. This may be due to the fact that the send is not complete or there is some limit on the server for the post request, which is why php cannot read the request completely. In the first case, the programmer can fix 1c, in the second case, the system administrator can increase the limits. You can also split the upload into smaller files of 1000 products, for example, then it should work fine.
30.11.2021, 17:24
Original comment available on version: ru

Thanks, we're checking
30.11.2021, 17:25
Original comment available on version: ru

Good evening.
Identified the problem.
In the example above, in which you showed a break in the transmitted xml, the problem was on the "&" character, it was not wrapped in CDATA and a break occurred at this point. We fixed this by wrapping this field in CDATA. But OneBox still doesn't process products that have this symbol.
I have now enabled unloading exclusively with one product that has this symbol in the name, the rest of it is not updated, please check what is happening on the OneBox side
01.12.2021, 17:24
Original comment available on version: ru

Just in case, I will attach the xml that we are now sending with this one item
01.12.2021, 17:26
Original comment available on version: ru

Try replacing & with %26 throughout the file
02.12.2021, 10:56
Original comment available on version: ru

Yes, everything started working.
02.12.2021, 17:16
Original comment available on version: ru

glad I could help you. Have a good day.
07.12.2021, 11:07
Original comment available on version: ru

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment