Получение данных из 1С через brom

A

auem

Всем привет! Возникла проблема при получении видов номенклатур через расширение Brom на Python

Вот мой код:

Code:
from brom import *

клиент = БромКлиент(
    публикация="http://localhost/BROM",
    пользователь="brom",
    пароль=""
)

клиент.Справочники.ВидыНоменклатуры.НайтиПоНименованию("Товары")

Вот ошибка:

Code:
{
    "name": "TransportError",
    "message": "Server returned response (400) with invalid XML: Invalid XML content received (Start tag expected, '<' not found, line 1, column 1).
Content: b'\\xef\\xbb\\xbf{\"#exception\":\"{http://v8.1c.ru/8.1/data/core}Exception\",\"exception\":{\"clsid\":\"a01f465c-ed70-442e-ada5-847668d7a41c\",\"descr\":\"\\xd0\\x94\\xd0\\xbe\\xd1\\x81\\xd1\\x82\\xd0\\xb8\\xd0\\xb3\\xd0\\xbd\\xd1\\x83\\xd1\\x82\\xd0\\xbe \\xd0\\xbe\\xd0\\xb3\\xd1\\x80\\xd0\\xb0\\xd0\\xbd\\xd0\\xb8\\xd1\\x87\\xd0\\xb5\\xd0\\xbd\\xd0\\xb8\\xd0\\xb5 \\xd1\\x83\\xd1\\x87\\xd0\\xb5\\xd0\\xb1\\xd0\\xbd\\xd0\\xbe\\xd0\\xb9 \\xd0\\xb2\\xd0\\xb5\\xd1\\x80\\xd1\\x81\\xd0\\xb8\\xd0\\xb8\\\
\\xd0\\x94\\xd0\\xbe\\xd1\\x81\\xd1\\x82\\xd0\\xb8\\xd0\\xb3\\xd0\\xbd\\xd1\\x83\\xd1\\x82\\xd0\\xbe \\xd0\\xbf\\xd1\\x80\\xd0\\xb5\\xd0\\xb4\\xd0\\xb5\\xd0\\xbb\\xd1\\x8c\\xd0\\xbd\\xd0\\xbe\\xd0\\xb5 \\xd0\\xba\\xd0\\xbe\\xd0\\xbb\\xd0\\xb8\\xd1\\x87\\xd0\\xb5\\xd1\\x81\\xd1\\x82\\xd0\\xb2\\xd0\\xbe \\xd0\\xbf\\xd0\\xbe\\xd0\\xb4\\xd0\\xba\\xd0\\xbb\\xd1\\x8e\\xd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wMjdDQTgyIGNvcmU4M3QuZGxsOjB4MDAxNThFMzQgdWNydGJhc2UuZGxs\\\\r\\\
OjB4MDAwMDAwMDAgS0VSTkVMMzIuRExMOjB4MDAwMDAwMDAgdW5rbm93bjoweDAw\\\\r\\\
MDAwMDAwIHVua25vd246MHgwMDAwMDAwMCAiLCIwMDAwMDAwMDAwMDAwMDAwMDAw\\\\r\\\
MDAwMDAwIiwwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDB9LDM5\\\\r\\\
fQ==\",\"category\":\"0000000000000000000000000\",\"creationStack\":\"backendt.dll:0x00006DD6 backendt.dll:0x0058C1AE backendt.dll:0x0058ADEF vrsbaset.dll:0x000180B4 vrsbaset.dll:0x00017013 vrsbaset.dll:0x0001671E vrsbaset.dll:0x0011FCFE vrsbaset.dll:0x00120DBE vrsbaset.dll:0x0004DE83 vrsbaset.dll:0x00013083 vrsbaset.dll:0x00056176 vrsbaset.dll:0x0004B209 vrsbaset.dll:0x000564A4 vrsbaset.dll:0x00056E89 core83t.dll:0x0027CA20 core83t.dll:0x0027CA82 core83t.dll:0x00158E34 ucrtbase.dll:0x00000000 KERNEL32.DLL:0x00000000 unknown:0x00000000 unknown:0x00000000 \"}}'",
    "stack": "---------------------------------------------------------------------------
XMLSyntaxError                            Traceback (most recent call last)
File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\zeep\\loader.py:50, in parse_xml(content, transport, base_url, settings)
     49 try:
---> 50     elementtree = fromstring(content, parser=parser, base_url=base_url)
     51     docinfo = elementtree.getroottree().docinfo

File src\\\\lxml\\\\etree.pyx:3307, in lxml.etree.fromstring()

File src\\\\lxml\\\\parser.pxi:1989, in lxml.etree._parseMemoryDocument()

File src\\\\lxml\\\\parser.pxi:1876, in lxml.etree._parseDoc()

File src\\\\lxml\\\\parser.pxi:1164, in lxml.etree._BaseParser._parseDoc()

File src\\\\lxml\\\\parser.pxi:633, in lxml.etree._ParserContext._handleParseResultDoc()

File src\\\\lxml\\\\parser.pxi:743, in lxml.etree._handleParseResult()

File src\\\\lxml\\\\parser.pxi:672, in lxml.etree._raiseParseError()

XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1)

During handling of the above exception, another exception occurred:

XMLSyntaxError                            Traceback (most recent call last)
File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\zeep\\wsdl\\bindings\\soap.py:204, in SoapBinding.process_reply(self, client, operation, response)
    203 try:
--> 204     doc = parse_xml(content, self.transport, settings=client.settings)
    205 except XMLSyntaxError as exc:

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\zeep\\loader.py:66, in parse_xml(content, transport, base_url, settings)
     65 except etree.XMLSyntaxError as exc:
---> 66     raise XMLSyntaxError(
     67         \"Invalid XML content received (%s)\" % exc.msg, content=content
     68     )

XMLSyntaxError: Invalid XML content received (Start tag expected, '<' not found, line 1, column 1)

During handling of the above exception, another exception occurred:

TransportError                            Traceback (most recent call last)
Cell In[48], line 1
----> 1 клиент.Справочники.ВидыНоменклатуры.НайтиПоНименованию(\"Товары\")

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\brom.py:3065, in ОбъектыМенеджер.__getattr__(self, item)
   3064 def __getattr__(self, item):
-> 3065     return self.__tryget(item)

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\brom.py:3043, in ОбъектыМенеджер.__tryget(self, name)
   3042 def __tryget(self, name):
-> 3043     метаданные = self._moduleMetadata.Найти(name)
   3044     if метаданные:
   3045         if self.__collectionType == ТипКоллекции.Справочник:

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\brom.py:242, in УзелМетаданных.Найти(self, имя)
    240 результат = self;
    241 for текИмя in имена:
--> 242     узел = результат.НайтиПодчиненный(текИмя)
    243     if узел:
    244         результат = узел

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\brom.py:870, in МетаданныеКоллекция.НайтиПодчиненный(self, имя)
    867     if node != None:
    868         return ПостроительМетаданных.ПолучитьУзелИзSOAP(node, self)
--> 870 именаПодчиненных = self.ИменаПодчиненных()
    871 for текИмя in именаПодчиненных:
    872     if текИмя.lower() == имя.lower():

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\brom.py:846, in МетаданныеКоллекция.ИменаПодчиненных(self)
    843         self.__childrenNames = имена
    844         return self.__childrenNames
--> 846 картаИмен = self.Корень().ПолучитьИменаОбъектовКоллекций(self.Путь())
    847 имена = картаИмен[self.Путь()]
    848 if not имена == None:

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\brom.py:998, in МетаданныеКонфигурация.ПолучитьИменаОбъектовКоллекций(self, коллекции)
    997 def ПолучитьИменаОбъектовКоллекций(self, коллекции):
--> 998     result = self.__bromClient.SoapКлиент.service.GetMetadaChildrenNames(коллекции)
    999     return self.__bromClient.Сериализатор().ИзЗначенияБром(result)

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\zeep\\proxy.py:46, in OperationProxy.__call__(self, *args, **kwargs)
     43 if soap_headers:
     44     kwargs[\"_soapheaders\"] = soap_headers
---> 46 return self._proxy._binding.send(
     47     self._proxy._client,
     48     self._proxy._binding_options,
     49     self._op_name,
     50     args,
     51     kwargs,
     52 )

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\zeep\\wsdl\\bindings\\soap.py:135, in SoapBinding.send(self, client, options, operation, args, kwargs)
    132 if client.settings.raw_response:
    133     return response
--> 135 return self.process_reply(client, operation_obj, response)

File c:\\Users\\T\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\zeep\\wsdl\\bindings\\soap.py:206, in SoapBinding.process_reply(self, client, operation, response)
    204     doc = parse_xml(content, self.transport, settings=client.settings)
    205 except XMLSyntaxError as exc:
--> 206     raise TransportError(
    207         \"Server returned response (%s) with invalid XML: %s.\
Content: %r\"
    208         % (response.status_code, exc, response.content),
    209         status_code=response.status_code,
    210         content=response.content,
    211     )
    213 # Check if this is an XOP message which we need to decode first
    214 if message_pack:

TransportError: Server returned response (400) with invalid XML: Invalid XML content received (Start tag expected, '<' not found, line 1, column 1).
Content: b'\\xef\\xbb\\xbf{\"#exception\":\"{http://v8.1c.ru/8.1/data/core}Exception\",\"exception\":{\"clsid\":\"a01f465c-ed70-442e-ada5-847668d7a41c\",\"descr\":\"\\xd0\\x94\\xd0\\xbe\\xd1\\x81\\xd1\\x82\\xd0\\xb8\\xd0\\xb3\\xd0\\xbd\\xd1\\x83\\xd1\\x82\\xd0\\xbe \\xd0\\xbe\\xd0\\xb3\\xd1\\x80\\xd0\\xb0\\xd0\\xbd\\xd0\\xb8\\xd1\\x87\\xd0\\xb5\\xd0\\xbd\\xd0\\xb8\\xd0\\xb5 \\xd1\\x83\\xd1\\x87\\xd0\\xb5\\xd0\\xb1\\xd0\\xbd\\xd0\\xbe\\xd0\\xb9 \\xd0\\xb2\\xd0\\xb5\\xd1\\x80\\xd1\\x81\\xd0\\xb8\\xd0\\xb8\\\
\\xd0\\x94\\xd0\\xbe\\xd1\\x81\\xd1\\x82\\xd0\\xb8\\xd0\\xb3\\xd0\\xbd\\xd1\\x83\\xd1\\x82\\xd0\\xbe \\xd0\\xbf\\xd1\\x80\\xd0\\xb5\\xd0\\xb4\\xd0\\xb5\\xd0\\xbb\\xd1\\x8c\\xd0\\xbd\\xd0\\xbe\\xd0\\xb5 \\xd0\\xba\\xd0\\xbe\\xd0\\xbb\\xd0\\xb8\\xd1\\x87\\xd0\\xb5\\xd1\\x81\\xd1\\x82\\xd0\\xb2\\xd0\\xbe \\xd0\\xbf\\xd0\\xbe\\xd0\\xb4\\xd0\\xba\\xd0\\xbb\\xd1\\x8e\\xd1\\x87\\xd0\\xb5\\xd0\\xbd\\xd0\\xb8\\xd0\\xb9 \\xd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uZGxs\\\\r\\\
OjB4MDAwMDAwMDAgS0VSTkVMMzIuRExMOjB4MDAwMDAwMDAgdW5rbm93bjoweDAw\\\\r\\\
MDAwMDAwIHVua25vd246MHgwMDAwMDAwMCAiLCIwMDAwMDAwMDAwMDAwMDAwMDAw\\\\r\\\
MDAwMDAwIiwwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDB9LDM5\\\\r\\\
fQ==\",\"category\":\"0000000000000000000000000\",\"creationStack\":\"backendt.dll:0x00006DD6 backendt.dll:0x0058C1AE backendt.dll:0x0058ADEF vrsbaset.dll:0x000180B4 vrsbaset.dll:0x00017013 vrsbaset.dll:0x0001671E vrsbaset.dll:0x0011FCFE vrsbaset.dll:0x00120DBE vrsbaset.dll:0x0004DE83 vrsbaset.dll:0x00013083 vrsbaset.dll:0x00056176 vrsbaset.dll:0x0004B209 vrsbaset.dll:0x000564A4 vrsbaset.dll:0x00056E89 core83t.dll:0x0027CA20 core83t.dll:0x0027CA82 core83t.dll:0x00158E34 ucrtbase.dll:0x00000000 KERNEL32.DLL:0x00000000 unknown:0x00000000 unknown:0x00000000 \"}}'"
}
 

Unreplied Threads

How can I start a remote lsp server and specify a specific host and port to connect to with eglot?

I am developing directly on a development container in a container on a (remote) Kubernetes cluster. The container has an ssh-server which means that eglot can start the remote lsp-server through ssh.

Additionally I've set up port-forwarding to forward a port on the local machine to the lsp-server port on the container. In this way eglot can connect to the lsp-server through a port on my localhost.

However I am not able to find the correct commands to automatically make eglot start the lsp-server remotely and subsequently connect to the server on a local port.

With the following command added tot the eglot-server-programs I can get eglot to start the remote lsp-server (by running M-x eglot). (PS I run this command after I have opened a file on the remote container through tramp, eglot seems to find out automatically that the command to start the lsp-server should be run on the remote host).

Code:
  (add-to-list 'eglot-server-programs '((python-mode python-ts-mode) "pylsp" "--tcp" "--host=0.0.0.0" "--port" "5007"))

When subsequently I add the following to the eglot-server-programs and run M-x eglot again:

Code:
  (add-to-list 'eglot-server-programs '((python-mode python-ts-mode) "localhost" 5007))

Then eglot seems to connect to the server and things seem to work fine.

But again, I cannot get eglot to perform the two steps above automatically. Is there a way to make eglot preform both steps above by adding only a single entry to the 'eglot-server-programs list?

Or maybe there are two seperate commands that I can run to first start the remote-lsp server and subsequently to connect to the server though the local port?

Vertices connect to Mesh

  • Evert Gelders
  • Technology
  • Replies: 0
enter image description here

I want to connect these vertices to make a mesh, but I have no idea how to do it efficiently. I tried to do it manually but it cost a lot of time and I was probaby doing it wrong.

Separate Object into equal chunks by a grid

I have an terrain object that I want to divide into chunks of the same size. I already created a grid (black lines) with that I could slice the mesh. I want every chunk to be a separate object. Any ideas?

enter image description here

Decrypting base2i encryption?

We all know base64, which can be easily decoded, but there's also base2i encryption. Yes, the base is a complex number. I can only find very limited resources online about this. I'm wondering how can a plaintext be encrypted using base2i and then decrypted?

I've got this base2i encrypted ciphertext: 3030101000000000201030203010100030200020100030301030303030201000001000100000202020103010202030001010001000201010003020003020200020203000101000202010203030202020203030000030200000203000303030200030101020300010300030101020102010303020302020202010003010001

I tried to treat this as one large number and convert it to base10, but in base10 I got a complex number which doesn't make sense. Maybe I should decrypt this in chunks? Not sure how this works.

Login To add answer/comment

shapez2 - Why do the shape/fluid loaders have three levels?

  • ordago
  • Social
  • Replies: 0
I don't understand why the shape and fluid loaders have three levels, it looks like they only use one of the levels to load items. When the bottom level is overloaded, it doesn't load items in the middle level, and if a new shape or fluid is added, the bottom level is replaced with the new item instead of adding the new items to the middle level.

Problem is depicted on this gif:
Left most loader switches between red and green fluid, and the other two loaders can only load items on the bottom level insted of using the rest of the levels.

So I don't understand the point of having this three levels. Is it for storing more of the same item? or is it to have three different items stored? How can I take advantage of these three levels?

Delete only faces in whole scene

  • gilles tarnus
  • Technology
  • Replies: 0
I m trying to script that delete all faces in my scene, but not the edges and loose edges. I try many but still no good results. With GUI it works like that :

  • Select object
  • Go to edit mode
  • Select all
  • Hit delete
  • In context menu choose faces. That s it. Any hunt to script this ? Best regards, Gilles

Problemas con mi editor VSCode (Creo que es el scriptcs pero no encuentro solucion)

hace un tiempo he venido programando en VisualCode pero cuando intento correr el codigo en mi editor me da un error en la pestaña Output, el error es el siguiente: [Running] scriptcs "c:\Users\juand\Desktop\C#\Program.cs" "scriptcs" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable.

[Done] exited with code=1 in 2.002 seconds

tengo la carpeta de scriptcs en la misma carpeta donde estoy haciendo mi proyecto y ya he intentado solucionarlo agregandola al path y una infinidad de cosas diferentes pero nada me ayuda co eso, si alguien podria ayudarme se lo agradeceria mucho.
Top