int main(int argc, char * argv[]) { MediaBindingProxy service; _ns1__GetProfiles first; _ns1__GetProfilesResponse first_response; service.soap->userid = "admin"; service.soap->password = "******"; if(service.GetProfiles("http://192.168.22.71:81", NULL, &first, first_response ) == SOAP_OK) { std::cout<<"OK"<<"\n"; }else { service.soap_stream_fault(std::cerr); service.destroy(); // delete data and release memory :-) std::cout<<"NOT OK\n"; } }
inline int OnvifClientMedia::GetProfiles(_trt__GetProfilesResponse &profiles) { string strUrl; string strUser; string strPass; _trt__GetProfiles profilesReq; if (m_Device.GetUserPasswd(strUser, strPass) == false || m_Device.GetMediaUrl(strUrl) == false) { return SOAP_ERR; } mediaProxy.soap_endpoint = strUrl.c_str(); soap_wsse_add_Security(&mediaProxy); soap_wsse_add_UsernameTokenDigest(&mediaProxy, "Id", strUser.c_str() , strPass.c_str()); return mediaProxy.GetProfiles( &profilesReq, &profiles) ; }