void IncidenceConverter::setItemDescription(KCal::Incidence *incidence, ngwt__CalendarItem *item) { if(!incidence->description().isEmpty()) { ngwt__MessageBody *message = soap_new_ngwt__MessageBody(soap(), -1); message->part = *soap_new_std__vectorTemplateOfPointerTongwt__MessagePart(soap(), -1); ngwt__MessagePart *part = soap_new_ngwt__MessagePart(soap(), -1); xsd__base64Binary data; data.__ptr = (unsigned char *)qStringToChar(incidence->description().utf8()); data.__size = incidence->description().utf8().length(); part->id = 0; part->__item = data; part->contentId = 0; std::string *str = soap_new_std__string(soap(), -1); str->append("text/plain"); part->contentType = str; part->length = 0; // this is optional and sending the actual length of the source string truncates the data. part->offset = 0; // optional message->part.push_back(part); item->message = message; } else item->message = 0; }
int DeviceBindingService::GetHostname(_tds__GetHostname *tds__GetHostname, _tds__GetHostnameResponse *tds__GetHostnameResponse) { std::cout << __FUNCTION__ << std::endl; ServiceContext* ctx = (ServiceContext*)this->soap->user; if (!ctx->m_user.empty()) { // check authentification const char *username = soap_wsse_get_Username(this->soap); if (!username) return this->soap->error; if (ctx->m_user != username) return SOAP_FAULT; if (soap_wsse_verify_Password(this->soap, ctx->m_password.c_str())) return this->soap->error; } char buffer[HOST_NAME_MAX]; tds__GetHostnameResponse->HostnameInformation = soap_new_req_tt__HostnameInformation(this->soap, false); tds__GetHostnameResponse->HostnameInformation->Name = soap_new_std__string(this->soap); if (gethostname(buffer, sizeof(buffer)) == 0) { tds__GetHostnameResponse->HostnameInformation->Name->assign(buffer); } return SOAP_OK; }
std::string* GWConverter::qStringToString( const QString &string ) { std::string *str = soap_new_std__string( mSoap, -1 ); str->append( string.utf8() ); return str; }
tds__StorageConfiguration* ServiceContext::getStorageCfg(struct soap* soap, const std::string & path) { tds__StorageConfiguration* cfg = soap_new_tds__StorageConfiguration(soap); cfg->token = path; cfg->Data = soap_new_tds__StorageConfigurationData(soap); cfg->Data->LocalPath = soap_new_std__string(soap); cfg->Data->LocalPath->assign(path); return cfg; }
/*not supported web service.........*/ int __api__updateExecution( struct soap *soap, // request parameters: api__updateExecution* api__updateExecution_, // response parameters: api__updateExecutionResponse* api__updateExecutionResponse_ ){ api__updateExecutionResponse_->return_ = soap_new_api__Response(soap, 1); Execution execution = Execution(&config); bool is_success = false; bool type_error = false; std::string type_error_message = "For the moment, only string value can be accepted."; if(api__updateExecution_->keyValuePair[0]->__union_StringKeyValuePair != 1) { type_error = true; } is_success = execution.updateExecution(soap, api__updateExecution_->executionId, api__updateExecution_->keyValuePair[0]->name , *(api__updateExecution_->keyValuePair[0]->union_StringKeyValuePair.valueStr) ); if(is_success and (!type_error)) { api__updateExecutionResponse_->return_->statusCode = 0; // if you set __union_Response, please set the real reponse value as well. Otherwise it will produce //api__killExecutionResponse_->return_->__union_Response = 2; //api__killExecutionResponse_->return_->union_Response.returnedValueExecution = execution.m_api__Execution; }else{ api__updateExecutionResponse_->return_->statusCode = 1; api__updateExecutionResponse_->return_->errorMessage = (soap_new_std__string(soap, 1)); if(type_error) { (*api__updateExecutionResponse_->return_->errorMessage) = type_error_message; }else{ (*api__updateExecutionResponse_->return_->errorMessage) = execution.m_error_message; } } return SOAP_OK; std::cout << "__api__updateExecution" << std::endl; return SOAP_FATAL_ERROR; }
/* not supported web service.........*/ int __api__authenticateHTTP( struct soap *soap, // request parameters: api__authenticateHTTP* api__authenticateHTTP_, // response parameters: api__authenticateHTTPResponse* api__authenticateHTTPResponse_ ){ api__authenticateHTTPResponse_->return_ = soap_new_api__Response(soap, 1); api__authenticateHTTPResponse_->return_->statusCode = 1; api__authenticateHTTPResponse_->return_->errorMessage = (soap_new_std__string(soap, 1)); (*api__authenticateHTTPResponse_->return_->errorMessage) = "not supported"; return SOAP_FATAL_ERROR; }
int DevGetUsersResponse::AddUser(std::vector<std::string> user) { tt__User * pUser = soap_new_tt__User(this->d->soap,-1); pUser->Password = soap_new_std__string(this->d->soap,-1); pUser->Username = user[0]; *(pUser->Password) = user[1]; pUser->UserLevel = user[2] == "Administrator" ? tt__UserLevel__Administrator : user[2] == "Operator" ? tt__UserLevel__Operator : user[2] == "User" ? tt__UserLevel__User : user[2] == "Anonymous" ? tt__UserLevel__Anonymous : tt__UserLevel__Extended; this->d->User.push_back(pUser); return 0; }
int DeviceBindingService::GetDNS(_tds__GetDNS *tds__GetDNS, _tds__GetDNSResponse *tds__GetDNSResponse) { std::cout << __FUNCTION__ << std::endl; tds__GetDNSResponse->DNSInformation = soap_new_tt__DNSInformation(soap); struct __res_state state; res_ninit(&state); for (int i=0; i < state.nscount; i++) { tt__IPAddress* address = soap_new_tt__IPAddress(soap); address->Type = tt__IPType__IPv4; address->IPv4Address = soap_new_std__string(soap); address->IPv4Address->assign(inet_ntoa(state.nsaddr_list[i].sin_addr)); tds__GetDNSResponse->DNSInformation->DNSManual.push_back(address); } return SOAP_OK; }
int __api__authenticateSession( struct soap *soap, // request parameters: api__authenticateSession* api__authenticateSession_, // response parameters: api__authenticateSessionResponse* api__authenticateSessionResponse_ ) { //std::cout << "username:"******"password:"******"auth success" << std::endl; //std::cout << "api__authenticateSessionResponse_=" << api__authenticateSessionResponse_ << std::endl; api__authenticateSessionResponse_->return_->statusCode = 0; }else{ //std::cout << "auth fail" << std::endl; api__authenticateSessionResponse_->return_->statusCode = 1; api__authenticateSessionResponse_->return_->errorMessage = (soap_new_std__string(soap, 1)); (*api__authenticateSessionResponse_->return_->errorMessage) = catiwebAuth.m_error_message; } //std::cout << "http_version:" << soap->http_version << std::endl; //std::cout << "__api__authenticateSession" << std::endl; return SOAP_OK; }
int __api__listPipelines( struct soap *soap, // request parameters: api__listPipelines* api__listPipelines_, // response parameters: api__listPipelinesResponse* api__listPipelinesResponse_ ){ api__listPipelinesResponse_->return_ = soap_new_api__Response(soap, 1); Pipelines pipelines = Pipelines(&config); if(pipelines.request(soap, api__listPipelines_->studyIdentifier.c_str())) { api__listPipelinesResponse_->return_->statusCode = 0; api__listPipelinesResponse_->return_->__union_Response = 7; api__listPipelinesResponse_->return_->union_Response.returnedValueListPipelines = pipelines.m_pPipelines; }else{ api__listPipelinesResponse_->return_->statusCode = 1; api__listPipelinesResponse_->return_->errorMessage = (soap_new_std__string(soap, 1)); (*api__listPipelinesResponse_->return_->errorMessage) = pipelines.m_error_message; } return SOAP_OK; }
int DeviceBindingService::GetNetworkInterfaces(_tds__GetNetworkInterfaces *tds__GetNetworkInterfaces, _tds__GetNetworkInterfacesResponse *tds__GetNetworkInterfacesResponse) { std::cout << __FUNCTION__ << std::endl; char host[NI_MAXHOST]; struct ifaddrs *ifaddr = NULL; if (getifaddrs(&ifaddr) == 0) { // get MAC addresses std::map<std::string,std::string> eterMap; for (struct ifaddrs* ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { if ( (ifa->ifa_addr != NULL) && (ifa->ifa_addr->sa_family == AF_PACKET) ) { struct sockaddr_ll *s = (struct sockaddr_ll*)ifa->ifa_addr; std::ostringstream os; os << std::hex << std::setw(2) << std::setfill('0'); for (int i=0; i <s->sll_halen; i++) { if (i!=0) os <<":"; os << (int)s->sll_addr[i]; } eterMap[ifa->ifa_name] = os.str(); } } // get corresponding IP address for (struct ifaddrs* ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { int prefix = 0; if ( (ifa->ifa_netmask != NULL) && (ifa->ifa_netmask->sa_family == AF_INET) ) { unsigned int mask = htonl(((struct sockaddr_in *)(ifa->ifa_netmask))->sin_addr.s_addr); while (mask != 0) { mask <<= 1; prefix++; } } if ( (ifa->ifa_addr != NULL) && (ifa->ifa_addr->sa_family == AF_INET) ) { if ( ( (ifa->ifa_flags & IFF_LOOPBACK) == 0 ) && (getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), host, sizeof(host), NULL, 0, NI_NUMERICHOST) == 0) ) { tds__GetNetworkInterfacesResponse->NetworkInterfaces.push_back(soap_new_tt__NetworkInterface(this->soap)); tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->Enabled = true; tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->Info = soap_new_tt__NetworkInterfaceInfo(this->soap); tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->Info->Name = soap_new_std__string(this->soap); tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->Info->Name->assign(ifa->ifa_name); tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->Info->HwAddress = eterMap[ifa->ifa_name]; tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->IPv4 = soap_new_tt__IPv4NetworkInterface(this->soap); tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->IPv4->Config = soap_new_tt__IPv4Configuration(this->soap); tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->IPv4->Config->Manual.push_back(soap_new_tt__PrefixedIPv4Address(this->soap)); tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->IPv4->Config->Manual.back()->Address = host; tds__GetNetworkInterfacesResponse->NetworkInterfaces.back()->IPv4->Config->Manual.back()->PrefixLength = prefix; } } } } freeifaddrs(ifaddr); return SOAP_OK; }
int main(int argc, char* argv[]) { std::string url = "http://127.0.0.1:8080"; std::string username; std::string password; int c=0; while ((c = getopt (argc, argv, "hu:p:")) != -1) { switch (c) { case 'u': username = optarg; break; case 'p': password = optarg; break; case 'h': std::cout << argv[0] << " [-u username] [-p password] url" << std::endl; exit(0); break; } } if (optind<argc) { url = argv[optind]; } std::cout << "Connecting to " << url << std::endl; // create connection to devicemgmt.wsdl server DeviceBindingProxy deviceProxy(url.c_str()); // call Device::GetDeviceInformation std::cout << "=>Device::GetDeviceInformation" << std::endl; _tds__GetDeviceInformation tds__GetDeviceInformation; _tds__GetDeviceInformationResponse tds__GetDeviceInformationResponse; addSecurity(deviceProxy.soap, username, password); if (deviceProxy.GetDeviceInformation(&tds__GetDeviceInformation, &tds__GetDeviceInformationResponse) == SOAP_OK) { std::cout << "\tManufacturer:" << tds__GetDeviceInformationResponse.Manufacturer << std::endl; } else { deviceProxy.soap_stream_fault(std::cerr); } // call Device::GetHostname std::cout << "=>Device::GetHostname" << std::endl; _tds__GetHostname tds__GetHostname; _tds__GetHostnameResponse tds__GetHostnameResponse; addSecurity(deviceProxy.soap, username, password); if (deviceProxy.GetHostname(&tds__GetHostname, &tds__GetHostnameResponse) == SOAP_OK) { std::cout << "\tHostname:" << tds__GetHostnameResponse.HostnameInformation->Name->c_str() << std::endl; } else { deviceProxy.soap_stream_fault(std::cerr); } // call Device::GetNetworkInterfaces std::cout << "=>Device::GetNetworkInterfaces" << std::endl; _tds__GetNetworkInterfaces tds__GetNetworkInterfaces; _tds__GetNetworkInterfacesResponse tds__GetNetworkInterfacesResponse; addSecurity(deviceProxy.soap, username, password); if (deviceProxy.GetNetworkInterfaces(&tds__GetNetworkInterfaces, &tds__GetNetworkInterfacesResponse) == SOAP_OK) { for (auto iface : tds__GetNetworkInterfacesResponse.NetworkInterfaces) { if (iface->Info != NULL) { std::cout << "\t" << iface->Info->Name->c_str() << " " << iface->Info->HwAddress << std::endl; } if ( (iface->IPv4 != NULL) && (iface->IPv4->Config != NULL) ) { for (auto addr : iface->IPv4->Config->Manual) { std::cout << "\tIP:" << addr->Address << "/" << addr->PrefixLength << std::endl; } } } } else { deviceProxy.soap_stream_fault(std::cerr); } // call Device::GetServices std::cout << "=>Device::GetServices" << std::endl; _tds__GetServices tds__GetServices; tds__GetServices.IncludeCapability = true; _tds__GetServicesResponse tds__GetServicesResponse; addSecurity(deviceProxy.soap, username, password); if (deviceProxy.GetServices(&tds__GetServices, &tds__GetServicesResponse) == SOAP_OK) { for (auto service : tds__GetServicesResponse.Service) { std::cout << "\tns:" << service->Namespace << " " << service->XAddr << " Version:" << service->Version->Major << "." << service->Version->Minor << std::endl; if (service->Capabilities) { std::cout << "\t" << service->Capabilities->__any << std::endl; } } } // call Device::GetCapabilities std::cout << "=>Device::GetCapabilities" << std::endl; _tds__GetCapabilities tds__GetCapabilities; _tds__GetCapabilitiesResponse tds__GetCapabilitiesResponse; addSecurity(deviceProxy.soap, username, password); if (deviceProxy.GetCapabilities(&tds__GetCapabilities, &tds__GetCapabilitiesResponse) == SOAP_OK) { std::unique_ptr<ImagingBindingProxy> imagingProxy; if ( (tds__GetCapabilitiesResponse.Capabilities->Extension != NULL) && (tds__GetCapabilitiesResponse.Capabilities->Imaging != NULL) ) { std::cout << "\tImaging Url:" << tds__GetCapabilitiesResponse.Capabilities->Imaging->XAddr << std::endl; imagingProxy.reset(new ImagingBindingProxy(tds__GetCapabilitiesResponse.Capabilities->Imaging->XAddr.c_str())); } std::unique_ptr<ReplayBindingProxy> replayProxy; if ( (tds__GetCapabilitiesResponse.Capabilities->Extension != NULL) && (tds__GetCapabilitiesResponse.Capabilities->Extension->Replay != NULL) ) { std::cout << "\tReplay Url:" << tds__GetCapabilitiesResponse.Capabilities->Extension->Replay->XAddr << std::endl; replayProxy.reset(new ReplayBindingProxy(tds__GetCapabilitiesResponse.Capabilities->Extension->Replay->XAddr.c_str())); } std::unique_ptr<MediaBindingProxy> mediaProxy; if (tds__GetCapabilitiesResponse.Capabilities->Media != NULL) { std::cout << "\tMedia Url:" << tds__GetCapabilitiesResponse.Capabilities->Media->XAddr << std::endl; mediaProxy.reset(new MediaBindingProxy(tds__GetCapabilitiesResponse.Capabilities->Media->XAddr.c_str())); } std::unique_ptr<ReceiverBindingProxy> receiverProxy; if ( (tds__GetCapabilitiesResponse.Capabilities->Extension != NULL) && (tds__GetCapabilitiesResponse.Capabilities->Extension->Receiver != NULL) ) { std::cout << "\tReceiver Url:" << tds__GetCapabilitiesResponse.Capabilities->Extension->Receiver->XAddr << std::endl; receiverProxy.reset(new ReceiverBindingProxy(tds__GetCapabilitiesResponse.Capabilities->Extension->Receiver->XAddr.c_str())); } std::unique_ptr<RecordingBindingProxy> recordingProxy; if ( (tds__GetCapabilitiesResponse.Capabilities->Extension != NULL) && (tds__GetCapabilitiesResponse.Capabilities->Extension->Recording != NULL) ) { std::cout << "\tRecording Url:" << tds__GetCapabilitiesResponse.Capabilities->Extension->Recording->XAddr << std::endl; recordingProxy.reset(new RecordingBindingProxy(tds__GetCapabilitiesResponse.Capabilities->Extension->Recording->XAddr.c_str())); } std::unique_ptr<SearchBindingProxy> searchProxy; if ( (tds__GetCapabilitiesResponse.Capabilities->Extension != NULL) && (tds__GetCapabilitiesResponse.Capabilities->Extension->Search != NULL) ) { std::cout << "\tSearch Url:" << tds__GetCapabilitiesResponse.Capabilities->Extension->Search->XAddr << std::endl; searchProxy.reset (new SearchBindingProxy(tds__GetCapabilitiesResponse.Capabilities->Extension->Search->XAddr.c_str())); } std::unique_ptr<EventBindingProxy> eventProxy; if (tds__GetCapabilitiesResponse.Capabilities->Events != NULL) { std::cout << "\tEvent Url:" << tds__GetCapabilitiesResponse.Capabilities->Events->XAddr << std::endl; eventProxy.reset(new EventBindingProxy(tds__GetCapabilitiesResponse.Capabilities->Events->XAddr.c_str())); } if (mediaProxy.get() != NULL) { // call Media::GetVideoSources std::cout << "=>Media::GetVideoSources" << std::endl; _trt__GetVideoSources trt__GetVideoSources; _trt__GetVideoSourcesResponse trt__GetVideoSourcesResponse; addSecurity(mediaProxy->soap, username, password); if (mediaProxy->GetVideoSources(&trt__GetVideoSources, &trt__GetVideoSourcesResponse) == SOAP_OK) { for (auto source : trt__GetVideoSourcesResponse.VideoSources) { std::cout << "\t" << source->token; if (source->Resolution) { std::cout << " " << source->Resolution->Width << "x" << source->Resolution->Height; } std::cout << std::endl; _trt__GetVideoEncoderConfiguration trt__GetVideoEncoderConfiguration; trt__GetVideoEncoderConfiguration.ConfigurationToken = source->token; _trt__GetVideoEncoderConfigurationResponse trt__GetVideoEncoderConfigurationResponse; addSecurity(mediaProxy->soap, username, password); if (mediaProxy->GetVideoEncoderConfiguration(&trt__GetVideoEncoderConfiguration, &trt__GetVideoEncoderConfigurationResponse) == SOAP_OK) { std::cout << "\tEncoding:" << trt__GetVideoEncoderConfigurationResponse.Configuration->Encoding << std::endl; if (trt__GetVideoEncoderConfigurationResponse.Configuration->H264) { std::cout << "\tH264Profile:" << trt__GetVideoEncoderConfigurationResponse.Configuration->H264->H264Profile << std::endl; } if (trt__GetVideoEncoderConfigurationResponse.Configuration->Resolution) { std::cout << "\tResolution:" << trt__GetVideoEncoderConfigurationResponse.Configuration->Resolution->Width << "x" << trt__GetVideoEncoderConfigurationResponse.Configuration->Resolution->Height << std::endl; } } _trt__GetVideoEncoderConfigurationOptions trt__GetVideoEncoderConfigurationOptions; trt__GetVideoEncoderConfigurationOptions.ConfigurationToken = soap_new_std__string(mediaProxy->soap); trt__GetVideoEncoderConfigurationOptions.ConfigurationToken->assign(source->token); _trt__GetVideoEncoderConfigurationOptionsResponse trt__GetVideoEncoderConfigurationOptionsResponse; addSecurity(mediaProxy->soap, username, password); if (mediaProxy->GetVideoEncoderConfigurationOptions(&trt__GetVideoEncoderConfigurationOptions, &trt__GetVideoEncoderConfigurationOptionsResponse) == SOAP_OK) { if (trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264) { for (auto res : trt__GetVideoEncoderConfigurationOptionsResponse.Options->H264->ResolutionsAvailable) { std::cout << "\tResolution:" << res->Width << "x" << res->Height << std::endl; } } } if (imagingProxy.get() != NULL) { _timg__GetImagingSettings timg__GetImagingSettings; timg__GetImagingSettings.VideoSourceToken = source->token; _timg__GetImagingSettingsResponse timg__GetImagingSettingsResponse; addSecurity(imagingProxy->soap, username, password); if (imagingProxy->GetImagingSettings(&timg__GetImagingSettings, &timg__GetImagingSettingsResponse) == SOAP_OK) { std::cout << "\tBrightness :" << printPtr (timg__GetImagingSettingsResponse.ImagingSettings->Brightness) << std::endl; std::cout << "\tContrast :" << printPtr (timg__GetImagingSettingsResponse.ImagingSettings->Contrast) << std::endl; std::cout << "\tSaturation :" << printPtr (timg__GetImagingSettingsResponse.ImagingSettings->ColorSaturation) << std::endl; std::cout << "\tSharpness :" << printPtr (timg__GetImagingSettingsResponse.ImagingSettings->Sharpness) << std::endl; std::cout << "\tBacklight :" << printMode(timg__GetImagingSettingsResponse.ImagingSettings->BacklightCompensation) << std::endl; std::cout << "\tWideDynamic :" << printMode(timg__GetImagingSettingsResponse.ImagingSettings->WideDynamicRange) << std::endl; std::cout << "\tExposure :" << printMode(timg__GetImagingSettingsResponse.ImagingSettings->Exposure) << std::endl; if (timg__GetImagingSettingsResponse.ImagingSettings->Exposure) std::cout << "\t\tExposureTime :" << printPtr(timg__GetImagingSettingsResponse.ImagingSettings->Exposure->ExposureTime) << std::endl; std::cout << "\tWhiteBalance:" << printMode(timg__GetImagingSettingsResponse.ImagingSettings->WhiteBalance) << std::endl; } _timg__GetOptions timg__GetOptions; timg__GetOptions.VideoSourceToken = source->token; _timg__GetOptionsResponse timg__GetOptionsResponse; addSecurity(imagingProxy->soap, username, password); if (imagingProxy->GetOptions(&timg__GetOptions, &timg__GetOptionsResponse) == SOAP_OK) { std::cout << "\tBrightness: " << printRangePtr(timg__GetOptionsResponse.ImagingOptions->Brightness) << std::endl; std::cout << "\tContrast : " << printRangePtr(timg__GetOptionsResponse.ImagingOptions->Contrast) << std::endl; std::cout << "\tSaturation: " << printRangePtr(timg__GetOptionsResponse.ImagingOptions->ColorSaturation) << std::endl; std::cout << "\tSharpness : " << printRangePtr(timg__GetOptionsResponse.ImagingOptions->Sharpness) << std::endl; } } } } std::cout << "=>Media::GetProfiles" << std::endl; _trt__GetProfiles trt__GetProfiles; _trt__GetProfilesResponse trt__GetProfilesResponse; addSecurity(mediaProxy->soap, username, password); if (mediaProxy->GetProfiles(&trt__GetProfiles, &trt__GetProfilesResponse) == SOAP_OK) { for (auto profile : trt__GetProfilesResponse.Profiles) { std::string token(profile->token); std::cout << "\tMediaProfile:" << token << std::endl; _trt__GetStreamUri trt__GetStreamUri; _trt__GetStreamUriResponse trt__GetStreamUriResponse; trt__GetStreamUri.ProfileToken = token; trt__GetStreamUri.StreamSetup = soap_new_tt__StreamSetup(mediaProxy->soap); trt__GetStreamUri.StreamSetup->Transport = soap_new_tt__Transport(mediaProxy->soap); trt__GetStreamUri.StreamSetup->Transport->Protocol = tt__TransportProtocol__RTSP; addSecurity(mediaProxy->soap, username, password); if (mediaProxy->GetStreamUri(&trt__GetStreamUri, &trt__GetStreamUriResponse) == SOAP_OK) { std::cout << "\tMediaUri:" << trt__GetStreamUriResponse.MediaUri->Uri << std::endl; } } } } if (recordingProxy.get() != NULL) { std::cout << "=>Recording::GetRecordings" << std::endl; _trc__GetRecordings trc__GetRecordings; _trc__GetRecordingsResponse trc__GetRecordingsResponse; addSecurity(recordingProxy->soap, username, password); if (recordingProxy->GetRecordings(&trc__GetRecordings, &trc__GetRecordingsResponse) == SOAP_OK) { for (auto recording : trc__GetRecordingsResponse.RecordingItem) { std::string token(recording->RecordingToken); std::cout << "\tRecording:" << token << std::endl; if (replayProxy.get() != NULL) { _trp__GetReplayUri trp__GetReplayUri; _trp__GetReplayUriResponse trp__GetReplayUriResponse; trp__GetReplayUri.RecordingToken = token; addSecurity(replayProxy->soap, username, password); if (replayProxy->GetReplayUri(&trp__GetReplayUri, &trp__GetReplayUriResponse) == SOAP_OK) { std::cout << "\tReplay Uri:" << trp__GetReplayUriResponse.Uri << std::endl; } } } } std::cout << "=>Recording::GetRecordingJobs" << std::endl; _trc__GetRecordingJobs trc__GetRecordingJobs; _trc__GetRecordingJobsResponse trc__GetRecordingJobsResponse; addSecurity(recordingProxy->soap, username, password); if (recordingProxy->GetRecordingJobs(&trc__GetRecordingJobs, &trc__GetRecordingJobsResponse) == SOAP_OK) { for (auto job : trc__GetRecordingJobsResponse.JobItem) { std::string token(job->JobToken); std::cout << "\tRecordingJob:" << token << std::endl; if (job->JobConfiguration) { std::cout << "\tRecordingToken:" << job->JobConfiguration->RecordingToken << std::endl; for (auto src : job->JobConfiguration->Source) { if (src->SourceToken) { std::cout << "\tSourceToken:" << src->SourceToken->Token << std::endl; std::cout << "\tSourceType:" << src->SourceToken->Type << std::endl; } } } } } } if (receiverProxy.get() != NULL) { std::cout << "=>Receiver::GetReceivers" << std::endl; _trv__GetReceivers trv__GetReceivers; _trv__GetReceiversResponse trv__GetReceiversResponse; addSecurity(receiverProxy->soap, username, password); if (receiverProxy->GetReceivers(&trv__GetReceivers, &trv__GetReceiversResponse) == SOAP_OK) { for (auto receiver : trv__GetReceiversResponse.Receivers) { std::string token(receiver->Token); std::cout << "\tReceiver:" << token << std::endl; if (receiver->Configuration) { std::cout << "\tReceiver mode:" << receiver->Configuration->Mode << " uri:" << receiver->Configuration->MediaUri << std::endl; } } } } if (eventProxy.get() != NULL) { std::cout << "=>Event::CreatePullPoint" << std::endl; _tev__CreatePullPointSubscription tev__CreatePullPointSubscription; _tev__CreatePullPointSubscriptionResponse tev__CreatePullPointSubscriptionResponse; addSecurity(eventProxy->soap, username, password); if (eventProxy->CreatePullPointSubscription(&tev__CreatePullPointSubscription, &tev__CreatePullPointSubscriptionResponse) == SOAP_OK) { std::cout << "\tPullpoint Url:" << tev__CreatePullPointSubscriptionResponse.SubscriptionReference.Address << std::endl; // pull PullPointSubscriptionBindingProxy pullpoint(tev__CreatePullPointSubscriptionResponse.SubscriptionReference.Address); soap_wsse_add_Security(pullpoint.soap); _tev__PullMessages tev__PullMessages; tev__PullMessages.Timeout = "PT10S"; tev__PullMessages.MessageLimit = 100; _tev__PullMessagesResponse tev__PullMessagesResponse; if (pullpoint.PullMessages(&tev__PullMessages, &tev__PullMessagesResponse) == SOAP_OK) { for (auto msg : tev__PullMessagesResponse.wsnt__NotificationMessage) { std::cout << "\tMessage:" << msg->Message.__any << std::endl; } } // subscribe NotificationConsumerBindingService consumer; consumer.soap->accept_timeout=5; consumer.bind(NULL,9090,10); std::thread th(&NotificationConsumerBindingService::run, &consumer, 0); NotificationProducerBindingProxy producer(tev__CreatePullPointSubscriptionResponse.SubscriptionReference.Address); soap_wsse_add_Security(producer.soap); _wsnt__Subscribe wsnt__Subscribe; std::string url("http://127.0.0.1:9090"); wsnt__Subscribe.ConsumerReference.Address = strcpy((char*)soap_malloc(producer.soap, url.size()+1), url.c_str()); _wsnt__SubscribeResponse wsnt__SubscribeResponse; if (producer.Subscribe(&wsnt__Subscribe, &wsnt__SubscribeResponse) == SOAP_OK) { } th.join(); } } } return 0; }