中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

onvif client Discovery實現

發布時間:2020-06-30 13:15:15 來源:網絡 閱讀:4280 作者:llf_17 欄目:編程語言

省略:onvif client soapRemoteDiscoveryBindingProxy 由 gsoap C++ 方式生成


#include "soapRemoteDiscoveryBindingProxy.h"

#include "RemoteDiscoveryBinding.nsmap"

#include<string>

using namespace  std;



SOAP_FMAC5 int SOAP_FMAC6 soap_send___wsdd__Probe(struct soap *soap, const char *soap_endpoint, const char *soap_action, struct wsdd__ProbeType *wsdd__Probe)

{ struct __wsdd__Probe soap_tmp___wsdd__Probe;

if (soap_action == NULL)

soap_action = "http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe";

soap_tmp___wsdd__Probe.wsdd__Probe = wsdd__Probe;

soap_begin(soap);

soap_set_version(soap, 2); /* SOAP1.2 */

soap->encodingStyle = NULL;

soap_serializeheader(soap);

soap_serialize___wsdd__Probe(soap, &soap_tmp___wsdd__Probe);

if (soap_begin_count(soap))

return soap->error;

if (soap->mode & SOAP_IO_LENGTH)

{ if (soap_envelope_begin_out(soap)

|| soap_putheader(soap)

|| soap_body_begin_out(soap)

|| soap_put___wsdd__Probe(soap, &soap_tmp___wsdd__Probe, "-wsdd:Probe", "")

|| soap_body_end_out(soap)

|| soap_envelope_end_out(soap))

return soap->error;

}

if (soap_end_count(soap))

return soap->error;

if (soap_connect(soap, soap_endpoint, soap_action)

|| soap_envelope_begin_out(soap)

|| soap_putheader(soap)

|| soap_body_begin_out(soap)

|| soap_put___wsdd__Probe(soap, &soap_tmp___wsdd__Probe, "-wsdd:Probe", "")

|| soap_body_end_out(soap)

|| soap_envelope_end_out(soap)

|| soap_end_send(soap))

return soap_closesock(soap);

return SOAP_OK;

}



SOAP_FMAC5 int SOAP_FMAC6 soap_recv___wsdd__ProbeMatches(struct soap *soap, struct __wsdd__ProbeMatches *_param_1)

{

soap_default___wsdd__ProbeMatches(soap, _param_1);

soap_begin(soap);

if (soap_begin_recv(soap)

|| soap_envelope_begin_in(soap)

|| soap_recv_header(soap)

|| soap_body_begin_in(soap))

return soap_closesock(soap);

soap_get___wsdd__ProbeMatches(soap, _param_1, "-wsdd:ProbeMatches", NULL);

if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2)

soap->error = SOAP_OK;

if (soap->error

|| soap_body_end_in(soap)

|| soap_envelope_end_in(soap)

|| soap_end_recv(soap))

return soap_closesock(soap);

return soap_closesock(soap);

}

int main()  

{  

struct soap *soap;

struct wsdd__ProbeType req; 

struct __wsdd__ProbeMatches resp;

struct wsdd__ScopesType sScope;

struct SOAP_ENV__Header header;

int count = 0;

int result = 0; 


char guid_string[100];


soap = soap_new(); 

if (soap == NULL)

{

return -1;

}

 

soap_set_namespaces(soap, namespaces); 


soap->recv_timeout = 3; //超過x秒鐘沒有數據就退出

soap_default_SOAP_ENV__Header(soap, &header);

 

header.wsa__MessageID = guid_string;

header.wsa__To = "urn:schemas-xmlsoap-org:ws:2005:04:discovery";

header.wsa__Action = "http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe";

soap->header = &header;


soap_default_wsdd__ScopesType(soap, &sScope);

sScope.__item = "";

soap_default_wsdd__ProbeType(soap, &req);

req.Scopes = &sScope;

req.Types = "dn:NetworkVideoTransmitter";

  

  result = soap_send___wsdd__Probe(soap, "soap.udp://239.255.255.250:3702", NULL, &req);

int i = 0,nFindDev=0;

while (i++<10)

{

printf("soap_discovery_recv...\n");

result = soap_recv___wsdd__ProbeMatches(soap,&resp);

if (result == SOAP_OK)

{


if (!(soap->header))

{

printf("continue++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");

continue;

}

nFindDev++;


cout << "=========================================" << endl;

 

cout << "Match size:" << resp.wsdd__ProbeMatches->__sizeProbeMatch << endl;

cout << "xsd-unsignedInt:" << resp.wsdd__ProbeMatches->ProbeMatch->MetadataVersion << endl;

cout << "scopes item:" << resp.wsdd__ProbeMatches->ProbeMatch->Scopes->__item << endl;

cout << "QName:" << resp.wsdd__ProbeMatches->ProbeMatch->Types << endl;

cout << "xsd:string:" << resp.wsdd__ProbeMatches->ProbeMatch->wsa__EndpointReference.Address << endl;

cout << "xsd:QName:" << resp.wsdd__ProbeMatches->ProbeMatch->wsa__EndpointReference.PortType << endl;

cout << "wsa:ServiceNameType:" << resp.wsdd__ProbeMatches->ProbeMatch->wsa__EndpointReference.ServiceName << endl;

cout << "sequence of elements:" << resp.wsdd__ProbeMatches->ProbeMatch->wsa__EndpointReference.__size << endl;

cout << "xsd:anyType:" << resp.wsdd__ProbeMatches->ProbeMatch->wsa__EndpointReference.__anyAttribute << endl;

cout << "endpoint any:" << resp.wsdd__ProbeMatches->ProbeMatch->wsa__EndpointReference.__any << endl;

cout << "wsdd:UriListType:" << resp.wsdd__ProbeMatches->ProbeMatch->XAddrs << endl;


}

else

printf("2soap error: %d, %s, %s@@@@@@@@@@@\n", soap->error, *soap_faultcode(soap), *soap_faultstring(soap)); 

break;



}

printf("exit while,find dev:%d\n", nFindDev);

// remove deserialized class instances (C++ only)

soap_destroy(soap);


// clean up and remove deserialized data

soap_end(soap); 


////////////////////////////////////////////////////////////////////////////

soap_free(soap);//detach and free runtime context

soap_done(soap); // detach context (last use and no longer in scope)

  

    return result;   





向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

许昌县| 公主岭市| 康定县| 西平县| 色达县| 清新县| 福安市| 通道| 邹城市| 嘉鱼县| 安平县| 青川县| 闵行区| 湖北省| 申扎县| 克山县| 古丈县| 平安县| 宽甸| 交口县| 安远县| 怀集县| 应城市| 安顺市| 平江县| 霞浦县| 五常市| 英吉沙县| 秀山| 新丰县| 怀仁县| 墨脱县| 诸暨市| 卢龙县| 郯城县| 布拖县| 铁力市| 定日县| 平江县| 留坝县| 甘德县|