资源简介

onvif ptz控制 soap协议, 视频监控方面, 大的监控公司源码. 仅供学习

资源截图

代码片段和文件信息

#include “RemoteDiscoveryEntility.h“

#include  
#include  
#include  
#include 
#include 

#define RETURN_ERROR  -1
#define RETURN_OK  0

int RemoteDiscoveryEntility::soap_discovery_start_do(struct soap *soap struct __dndl__Probe *soap_tmp___dndl__Probe)
{
if (soap_envelope_begin_out(soap))
{
printf(“soap_envelope_begin_out(soap) ERROR\n“);
return RETURN_ERROR;
}

if (soap_putheader(soap))
{
printf(“soap_putheader ERROR\n“);
return RETURN_ERROR;
}

if (soap_body_begin_out(soap))
{
printf(“soap_body_begin_out ERROR\n“);
return RETURN_ERROR;
}

if (soap_put___dndl__Probe(soap soap_tmp___dndl__Probe “-dndl:Probe“ NULL))
{
printf(“soap_put___dndl__Probe ERROR\n“);
return RETURN_ERROR;
}

if (soap_body_end_out(soap))
{
printf(“soap_body_end_out ERROR\n“);
return RETURN_ERROR;
}

if (soap_envelope_end_out(soap))
{
printf(“soap_envelope_end_out ERROR\n“);
return RETURN_ERROR;
}

return RETURN_OK;
}

SOAP_FMAC5 int SOAP_FMAC6 RemoteDiscoveryEntility::soap_discovery_start(struct soap *soap const char *soap_endpoint 
       const char *soap_action struct d__ProbeType *d__Probe)
{
struct __dndl__Probe soap_tmp___dndl__Probe;
char default_soap_action[] = “http://www.onvif.org/ver10/network/wsdl/Probe“;

if (NULL == soap_action)
{
soap_action = default_soap_action;
}

soap->encodingstyle = NULL;
soap_tmp___dndl__Probe.d__Probe = d__Probe;
soap_begin(soap);
soap_serializeheader(soap);
soap_serialize___dndl__Probe(soap &soap_tmp___dndl__Probe);

if (soap_begin_count(soap))
{
printf(“soap_begin_count(soap) ERROR\n“);
return soap->error;
}

if (soap->mode & SOAP_IO_LENGTH)
{
if (RETURN_ERROR == soap_discovery_start_do(soap &soap_tmp___dndl__Probe))
{
return soap->error;
}

}

if (soap_end_count(soap))
{
printf(“soap_end_count ERROR\n“);
return soap->error;
}

if (soap_connect(soap soap_endpoint soap_action))
{
printf(“soap_connect(soap soap_endpoint soap_action) ERROR\n“);
return soap_closesock(soap);
}

if (RETURN_ERROR == soap_discovery_start_do(soap &soap_tmp___dndl__Probe))
{
return soap_closesock(soap);
}

if (soap_end_send(soap))
{
printf(“soap_end_send(soap) ERROR\n“);
return soap_closesock(soap);
}

return SOAP_OK;
}

SOAP_FMAC5 int SOAP_FMAC6 RemoteDiscoveryEntility::soap_discovery_recv(struct soap *soap struct d__ProbeMatchesType *d__ProbeMatches)
{
if (NULL == d__ProbeMatches)
{
soap_closesock(soap);
return RETURN_ERROR;
}

d__ProbeMatches->soap_default(soap);

if (soap_begin_recv(soap))
{
printf(“soap_begin_recv ERROR\n“);
return soap_closesock(soap);
}

if (soap_envelope_begin_in(soap))
{
printf(“soap_envelope_begin_in ERROR\n“);
return soap_closesock(soap);
}

if (soap_recv_header(soap))
{
printf(“soap_recv_hea

评论

共有 条评论