Another curl problem

Tags: #<Tag:0x00007f616c99bc70> #<Tag:0x00007f616c99bb58> #<Tag:0x00007f616c99ba18>

Good morning all

I’m trying to get some information from a XML file that will be generated with a curl command. For that I need to use another XML with the information to be sent. I’m on Windows and it works from the command line:

var String test = executeCommandLine(“curl -i -X POST -H ‘Content-Type: text/xml’ -H ‘SOAPAction: ‘http://www.phc.pt/RunCode’’ --data-binary @dadoslaser.xmlhttp://192.168.128.116/phc/ws/wscript.asmx’”, 3000)

The file dadoslaser.xml is on the \conf\html.
From the log:

2020-04-22 09:28:00.011 [INFO ] [e.smarthome.model.script.Xicofininho] - Warning: Couldn’t read data from file “dadoslaser.xml”, this makes an empty

Where should I put the xml file?

Thank you.

João

I finally solved the problem. Needed to put the complete path to the file’s location:

curl -i -X POST -H ‘Content-Type: text/xml’ -H ‘SOAPAction: ‘http://www.phc.pt/RunCode’’ --data-binary @C:\OpenHab2\userdata\xxxx\dadoslaser.xml ‘http://192.168.128.116/phc/ws/wscript.asmx’", 3000)

and use double \ to escape.

Hope this helps someone.

João

1 Like