2

I tried this code

import requests

res = requests.post('https://localhost:53443/OPCUA/SimulationServer', verify=False,data=b'HELFk\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\x7f\xff\xff\xff\x7f\x00\x00\x00\x00\x00\x00\x00\x00K\x00\x00\x00opc.https://localhost:53443/OPCUA/SimulationServer')

print(res.text)

Got an error saying, S€U   Bad_DecodingError (code=0x80070000, description="Unexpected NodeId Encoding Byte 72")

I am fetching data from, prosysopcua simulator

I am expecting any other way to establish this using python or any programming language

2 Answers2

1

There are some opc ua server that support some kind of http, but the protocol is more complex than one http request. In the spec there is a newer http protocol descriped, that to my knowlege , no opc ua server support.

The easiest way, that always works is using https://github.com/FreeOpcUa/opcua-asyncio.

Schroeder
  • 749
  • 4
  • 10
0

OPC UA supports HTTPS as a transport layer. It's not a REST API that you can GET/POST/etc requests to.

You need to connect with an OPC UA client. Use https://github.com/FreeOpcUa/opcua-asyncio if you're programming in Python. Don't bother with the HTTPS transport, just use the standard binary TCP transport, which still offers security if required.

Kevin Herron
  • 6,500
  • 3
  • 26
  • 35