1)由onvif官方的wsdl链接生成onvif.h头文件
wsdl2h -c -s -t typemap.dat -o onvif.h http://www.onvif.org/onvif/ver10/network/wsdl/remotediscovery.wsdl
2)soapcpp2.exe把onvif.h生成对应框架代码
soapcpp2.exe -2 -c onvif.h -I..\gsoap-2.8\gsoap\import -I..\gsoap-2.8\
-2: 使用soap1.2版本
-c: 生成c代码
注:
a.路径为实际的路径,根据自己环境进行具体设置
3)根据我前面一篇文件把一些无用的文件删除掉
4)保留真正要用到的文件
2014/11/08 14:26 509,842 stdsoap2.c
2016/07/04 11:02 23,882 soapStub.h
2016/07/04 11:02 21,693 soapClient.c
2014/11/08 14:26 98,504 stdsoap2.h
2016/07/04 16:55 11,513 soapServer.c
2016/07/04 11:02 725 wsdd.nsmap
2016/07/04 11:02 215,157 soapC.c
2016/07/04 11:02 95,813 soapH.h
5)编写main.c,主要填充__wsdd__Probe函数,socket层接收到discovery组播包后会自动调用此函数
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "soapH.h"
#include "wsdd.nsmap"
#include "soapStub.h"
SOAP_FMAC5 int SOAP_FMAC6 SOAP_ENV__Fault(struct soap* soap, char *faultcode, char *faultstring, char *faultactor,
struct SOAP_ENV__Detail *detail, struct SOAP_ENV__Code *_SOAP_ENV__Code,
struct SOAP_ENV__Reason *SOAP_ENV__Reason, char *SOAP_ENV__Node,
char *SOAP_ENV__Role, struct SOAP_ENV__Detail *SOAP_ENV__Detail)
{
return 0;
}
SOAP_FMAC5 int SOA