agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
692 stars 234 forks source link

action field in http header #225

Open RogerHardiman opened 2 years ago

RogerHardiman commented 2 years ago

I've got a camera that this library does not work with. ONVIF replies come back as empty replies on the HTTP connection with no XML.

I tracked it down to this library not putting an "action" field in the HTTP Content-Type header.

This is what ODM does _POST /onvif/deviceservice HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetSystemDateAndTime" Host: 192.168.1.15 Content-Length: 920 Accept-Encoding: gzip, deflate Connection: Close

Adding the action value makes this library work.

I've fixed it in the 'roger' branch. Would like a code review. It is not very efficient. It parses the XML it is about to send so it can make the action string. But it works