onvif学习总结

onvif学习总结

           开始接触onvif协议,不知道从哪里下手,就百度什么是onvif?接触的第一个文件onvif培训.ppt(http://download.csdn.net/detail/zhuyanling0106/5153310),可总觉得还不是很明白,后来知道了一个工具gsoap-2-8(http://download.csdn.net/detail/zhuyanling0106/5183814),后来就在网上找了很多资料去了解,也下了一些别人的例子,对discovery步骤如下:

1.        在onvif官网下载remotediscovery.wsdl文件   下载网站为:http://www.onvif.org/onvif/ver10/network/wsdl/remotediscovery.wsdl  直接拷贝这个链接, 放到下载工具中

2.       将工具中的typemap.dat文件加入到你编译的文件中,对typemap.dat文件进行更改:将一下加入到文件尾部

#       ONVIF recommended prefixes
tds     = "http://www.onvif.org/ver10/device/wsdl
"
tev     = "
http://www.onvif.org/ver10/events/wsdl
"
tls     = "
http://www.onvif.org/ver10/display/wsdl
"
tmd     = "
http://www.onvif.org/ver10/deviceIO/wsdl
"
timg    = "
http://www.onvif.org/ver20/imaging/wsdl
"
trt     = "
http://www.onvif.org/ver10/media/wsdl
"
tptz    = "
http://www.onvif.org/ver20/ptz/wsdl
"
trv     = "
http://www.onvif.org/ver10/receiver/wsdl
"
trc     = "
http://www.onvif.org/ver10/recording/wsdl
"
tse     = "
http://www.onvif.org/ver10/search/wsdl
"
trp     = "
http://www.onvif.org/ver10/replay/wsdl
"
tan     = "
http://www.onvif.org/ver20/analytics/wsdl
"
tad     = "
http://www.onvif.org/ver10/analyticsdevice/wsdl
"
tdn     = "
http://www.onvif.org/ver10/network/wsdl
"
tt      = "
http://www.onvif.org/ver10/schema
"
#       OASIS recommended prefixes
wsnt    = "
http://docs.oasis-open.org/wsn/b-2
"
wsntw   = "
http://docs.oasis-open.org/wsn/bw-2
"
wsrfbf  = "
http://docs.oasis-open.org/wsrf/bf-2
"
wsrfr   = "
http://docs.oasis-open.org/wsrf/r-2
"
wsrfrw  = "
http://docs.oasis-open.org/wsrf/rw-2
"
wstop   = "
http://docs.oasis-open.org/wsn/t-1
"
#       WS-Discovery 1.0 remapping
wsdd10__HelloType               = | wsdd__HelloType
wsdd10__ByeType                 = | wsdd__ByeType
wsdd10__ProbeType               = | wsdd__ProbeType
wsdd10__ProbeMatchesType        = | wsdd__ProbeMatchesType
wsdd10__ProbeMatchType          = | wsdd__ProbeMatchType
wsdd10__ResolveType             = | wsdd__ResolveType
wsdd10__ResolveMatchesType      = | wsdd__ResolveMatchesType
wsdd10__ResolveMatchType        = | wsdd__ResolveMatchType
#       SOAP-ENV mapping
SOAP_ENV__Envelope      = struct SOAP_ENV__Envelope { struct SOAP_ENV__Header *SOAP_ENV__Header; _XML SOAP_ENV__Body; }; | struct SOAP_ENV__Envelope
SOAP_ENV__Header        = | struct SOAP_ENV__Header
SOAP_ENV__Fault         = | struct SOAP_ENV__Fault
SOAP_ENV__Detail        = | struct SOAP_ENV__Detail
SOAP_ENV__Code          = | struct SOAP_ENV__Code
SOAP_ENV__Subcode       = | struct SOAP_ENV__Subcode

 

3.在linux中输入命令:wsdl2h   -o onvif.h -c -s -typemap.dat  .../remotediscovery.wsdl       生产onvif.h头文件

4.输入命令:    ./soapcpp2 -c onvif.h -x -I /home/user/gsoap-2.8/gsoap/import -I /home/user/gsoap-2.8/gsoap/         生产一些.h  .c  等文件

5.编写server和client函数

6.写makefill文件

7.编译

8.下载测试工具http://download.csdn.net/detail/zhuyanling0106/5161160

 

 

 

onvif  全部wsdl文件:http://www.onvif.org/onvif/ver20/util/operationIndex.html

你可能感兴趣的:(onvif)