In this example, I demonstrate how to retrieve a snapshot URI from an ONVIF complaint IP camera and download it locally. You can view the complete blog post associated with this project on my website.
The code is well commented and should be easy to read.
You will need curl to build the app.
Clone the example code from github:
git clone https://github.com/Sufi-Al-Hussaini/onvif-gsoap-by-example
Now, all you have to do is:
cd onvif-by-example
make
Run the program:
./ipconvif -cIp '<camera-ip>' -cUsr '<camera-username>' -cPwd '<camera-password>'
The base code for this project was adapted from the gsoap-onvif github repo originally written by tonyhu.