21.10.2019, 12:20
Hi:
I'm trying to extract data from Mitsubishi Web Server - SC-SL4
The data to request is:
mensaje = ='<Packet> \r\n' ..
<Command>getRequest</Command> \r\n' ..
<AirConditioner> \r\n' ..
<OpGroup GrNo="1" OnOff="*" Mode="*" ErrorStatus="*"></OpGroup>\r\n' ..
</AirConditioner> \r\n' ..
</Packet>\r\n' ..
The server response 'error 400: syntax error
This is my code:
Content = string.len(mensaje)
soap = '<?xml version="1.0" encoding="UTF-8"?>'
-- http request
reqs = 'POST /servlet/MIMEReceiveServlet.asp HTTP/1.1\r\n'..
'Content-Type: text/xml\r\n'..
'Content-Length: '..Content..'\r\n' ..
'\r\n' ..
soap..'\r\n' ..mensaje
sock = socket.tcp()
sockettimeout(70)
res, err = sock:connect(ip, port)
log(res,err)
if res then
res, err = sockend(reqs)
if res then
log('send OK ')
else
log('send failed: ' .. tostring(err))
end
else
log('connect failed: ' .. tostring(err))
end
res2, err2 = sock:receive("*a")
sock:close()
log(res2,err2)
The result is nil. We have another installation with another server and LMReactor and it works perfectly.
In this isntallation we have is with LMAmbient
I'm trying to extract data from Mitsubishi Web Server - SC-SL4
The data to request is:
mensaje = ='<Packet> \r\n' ..
<Command>getRequest</Command> \r\n' ..
<AirConditioner> \r\n' ..
<OpGroup GrNo="1" OnOff="*" Mode="*" ErrorStatus="*"></OpGroup>\r\n' ..
</AirConditioner> \r\n' ..
</Packet>\r\n' ..
The server response 'error 400: syntax error
This is my code:
Content = string.len(mensaje)
soap = '<?xml version="1.0" encoding="UTF-8"?>'
-- http request
reqs = 'POST /servlet/MIMEReceiveServlet.asp HTTP/1.1\r\n'..
'Content-Type: text/xml\r\n'..
'Content-Length: '..Content..'\r\n' ..
'\r\n' ..
soap..'\r\n' ..mensaje
sock = socket.tcp()
sockettimeout(70)
res, err = sock:connect(ip, port)
log(res,err)
if res then
res, err = sockend(reqs)
if res then
log('send OK ')
else
log('send failed: ' .. tostring(err))
end
else
log('connect failed: ' .. tostring(err))
end
res2, err2 = sock:receive("*a")
sock:close()
log(res2,err2)
The result is nil. We have another installation with another server and LMReactor and it works perfectly.
In this isntallation we have is with LMAmbient