You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

408 lines
15 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /* soapReplayBindingService.cpp
  2. Generated by gSOAP 2.8.17r from onvif.h
  3. Copyright(C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
  4. The generated code is released under one of the following licenses:
  5. GPL or Genivia's license for commercial use.
  6. This program is released under the GPL with the additional exemption that
  7. compiling, linking, and/or using OpenSSL is allowed.
  8. */
  9. #include "soapReplayBindingService.h"
  10. ReplayBindingService::ReplayBindingService()
  11. { ReplayBindingService_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
  12. }
  13. ReplayBindingService::ReplayBindingService(const struct soap &_soap) : soap(_soap)
  14. { }
  15. ReplayBindingService::ReplayBindingService(soap_mode iomode)
  16. { ReplayBindingService_init(iomode, iomode);
  17. }
  18. ReplayBindingService::ReplayBindingService(soap_mode imode, soap_mode omode)
  19. { ReplayBindingService_init(imode, omode);
  20. }
  21. ReplayBindingService::~ReplayBindingService()
  22. { }
  23. void ReplayBindingService::ReplayBindingService_init(soap_mode imode, soap_mode omode)
  24. { soap_imode(this, imode);
  25. soap_omode(this, omode);
  26. static const struct Namespace namespaces[] =
  27. {
  28. {"SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope", "http://schemas.xmlsoap.org/soap/envelope/", NULL},
  29. {"SOAP-ENC", "http://www.w3.org/2003/05/soap-encoding", "http://schemas.xmlsoap.org/soap/encoding/", NULL},
  30. {"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
  31. {"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
  32. {"c14n", "http://www.w3.org/2001/10/xml-exc-c14n#", NULL, NULL},
  33. {"wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", NULL, NULL},
  34. {"xenc", "http://www.w3.org/2001/04/xmlenc#", NULL, NULL},
  35. {"wsc", "http://schemas.xmlsoap.org/ws/2005/02/sc", NULL, NULL},
  36. {"ds", "http://www.w3.org/2000/09/xmldsig#", NULL, NULL},
  37. {"wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd", NULL},
  38. {"wsa", "http://schemas.xmlsoap.org/ws/2004/08/addressing", NULL, NULL},
  39. {"wsdd", "http://schemas.xmlsoap.org/ws/2005/04/discovery", NULL, NULL},
  40. {"chan", "http://schemas.microsoft.com/ws/2005/02/duplex", NULL, NULL},
  41. {"wsa5", "http://www.w3.org/2005/08/addressing", "http://schemas.xmlsoap.org/ws/2004/08/addressing", NULL},
  42. {"xmime", "http://tempuri.org/xmime.xsd", NULL, NULL},
  43. {"xop", "http://www.w3.org/2004/08/xop/include", NULL, NULL},
  44. {"tt", "http://www.onvif.org/ver10/schema", NULL, NULL},
  45. {"wsrfbf", "http://docs.oasis-open.org/wsrf/bf-2", NULL, NULL},
  46. {"wstop", "http://docs.oasis-open.org/wsn/t-1", NULL, NULL},
  47. {"wsrfr", "http://docs.oasis-open.org/wsrf/r-2", NULL, NULL},
  48. {"tdn", "http://www.onvif.org/ver10/network/wsdl", NULL, NULL},
  49. {"tds", "http://www.onvif.org/ver10/device/wsdl", NULL, NULL},
  50. {"tev", "http://www.onvif.org/ver10/events/wsdl", NULL, NULL},
  51. {"wsnt", "http://docs.oasis-open.org/wsn/b-2", NULL, NULL},
  52. {"timg", "http://www.onvif.org/ver20/imaging/wsdl", NULL, NULL},
  53. {"tls", "http://www.onvif.org/ver10/display/wsdl", NULL, NULL},
  54. {"tmd", "http://www.onvif.org/ver10/deviceIO/wsdl", NULL, NULL},
  55. {"tptz", "http://www.onvif.org/ver20/ptz/wsdl", NULL, NULL},
  56. {"trc", "http://www.onvif.org/ver10/recording/wsdl", NULL, NULL},
  57. {"trp", "http://www.onvif.org/ver10/replay/wsdl", NULL, NULL},
  58. {"trt", "http://www.onvif.org/ver10/media/wsdl", NULL, NULL},
  59. {"trv", "http://www.onvif.org/ver10/receiver/wsdl", NULL, NULL},
  60. {"tse", "http://www.onvif.org/ver10/search/wsdl", NULL, NULL},
  61. {NULL, NULL, NULL, NULL}
  62. };
  63. soap_set_namespaces(this, namespaces);
  64. }
  65. void ReplayBindingService::destroy()
  66. { soap_destroy(this);
  67. soap_end(this);
  68. }
  69. void ReplayBindingService::reset()
  70. { destroy();
  71. soap_done(this);
  72. soap_initialize(this);
  73. ReplayBindingService_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
  74. }
  75. #ifndef WITH_PURE_VIRTUAL
  76. ReplayBindingService *ReplayBindingService::copy()
  77. { ReplayBindingService *dup = SOAP_NEW_COPY(ReplayBindingService(*(struct soap*)this));
  78. return dup;
  79. }
  80. #endif
  81. int ReplayBindingService::soap_close_socket()
  82. { return soap_closesock(this);
  83. }
  84. int ReplayBindingService::soap_force_close_socket()
  85. { return soap_force_closesock(this);
  86. }
  87. int ReplayBindingService::soap_senderfault(const char *string, const char *detailXML)
  88. { return ::soap_sender_fault(this, string, detailXML);
  89. }
  90. int ReplayBindingService::soap_senderfault(const char *subcodeQName, const char *string, const char *detailXML)
  91. { return ::soap_sender_fault_subcode(this, subcodeQName, string, detailXML);
  92. }
  93. int ReplayBindingService::soap_receiverfault(const char *string, const char *detailXML)
  94. { return ::soap_receiver_fault(this, string, detailXML);
  95. }
  96. int ReplayBindingService::soap_receiverfault(const char *subcodeQName, const char *string, const char *detailXML)
  97. { return ::soap_receiver_fault_subcode(this, subcodeQName, string, detailXML);
  98. }
  99. void ReplayBindingService::soap_print_fault(FILE *fd)
  100. { ::soap_print_fault(this, fd);
  101. }
  102. #ifndef WITH_LEAN
  103. #ifndef WITH_COMPAT
  104. void ReplayBindingService::soap_stream_fault(std::ostream& os)
  105. { ::soap_stream_fault(this, os);
  106. }
  107. #endif
  108. char *ReplayBindingService::soap_sprint_fault(char *buf, size_t len)
  109. { return ::soap_sprint_fault(this, buf, len);
  110. }
  111. #endif
  112. void ReplayBindingService::soap_noheader()
  113. { this->header = NULL;
  114. }
  115. void ReplayBindingService::soap_header(struct _wsse__Security *wsse__Security, char *wsa__MessageID, struct wsa__Relationship *wsa__RelatesTo, struct wsa__EndpointReferenceType *wsa__From, struct wsa__EndpointReferenceType *wsa__ReplyTo, struct wsa__EndpointReferenceType *wsa__FaultTo, char *wsa__To, char *wsa__Action, struct wsdd__AppSequenceType *wsdd__AppSequence, char *wsa5__MessageID, struct wsa5__RelatesToType *wsa5__RelatesTo, struct wsa5__EndpointReferenceType *wsa5__From, struct wsa5__EndpointReferenceType *wsa5__ReplyTo, struct wsa5__EndpointReferenceType *wsa5__FaultTo, char *wsa5__To, char *wsa5__Action, struct chan__ChannelInstanceType *chan__ChannelInstance)
  116. { ::soap_header(this);
  117. this->header->wsse__Security = wsse__Security;
  118. this->header->wsa__MessageID = wsa__MessageID;
  119. this->header->wsa__RelatesTo = wsa__RelatesTo;
  120. this->header->wsa__From = wsa__From;
  121. this->header->wsa__ReplyTo = wsa__ReplyTo;
  122. this->header->wsa__FaultTo = wsa__FaultTo;
  123. this->header->wsa__To = wsa__To;
  124. this->header->wsa__Action = wsa__Action;
  125. this->header->wsdd__AppSequence = wsdd__AppSequence;
  126. this->header->wsa5__MessageID = wsa5__MessageID;
  127. this->header->wsa5__RelatesTo = wsa5__RelatesTo;
  128. this->header->wsa5__From = wsa5__From;
  129. this->header->wsa5__ReplyTo = wsa5__ReplyTo;
  130. this->header->wsa5__FaultTo = wsa5__FaultTo;
  131. this->header->wsa5__To = wsa5__To;
  132. this->header->wsa5__Action = wsa5__Action;
  133. this->header->chan__ChannelInstance = chan__ChannelInstance;
  134. }
  135. const SOAP_ENV__Header *ReplayBindingService::soap_header()
  136. { return this->header;
  137. }
  138. int ReplayBindingService::run(int port)
  139. { if (soap_valid_socket(this->master) || soap_valid_socket(bind(NULL, port, 100)))
  140. { for (;;)
  141. { if (!soap_valid_socket(accept()) || serve())
  142. return this->error;
  143. soap_destroy(this);
  144. soap_end(this);
  145. }
  146. }
  147. else
  148. return this->error;
  149. return SOAP_OK;
  150. }
  151. SOAP_SOCKET ReplayBindingService::bind(const char *host, int port, int backlog)
  152. { return soap_bind(this, host, port, backlog);
  153. }
  154. SOAP_SOCKET ReplayBindingService::accept()
  155. { return soap_accept(this);
  156. }
  157. #if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
  158. int ReplayBindingService::ssl_accept()
  159. { return soap_ssl_accept(this);
  160. }
  161. #endif
  162. int ReplayBindingService::serve()
  163. {
  164. #ifndef WITH_FASTCGI
  165. unsigned int k = this->max_keep_alive;
  166. #endif
  167. do
  168. {
  169. #ifndef WITH_FASTCGI
  170. if (this->max_keep_alive > 0 && !--k)
  171. this->keep_alive = 0;
  172. #endif
  173. if (soap_begin_serve(this))
  174. { if (this->error >= SOAP_STOP)
  175. continue;
  176. return this->error;
  177. }
  178. if (dispatch() || (this->fserveloop && this->fserveloop(this)))
  179. {
  180. #ifdef WITH_FASTCGI
  181. soap_send_fault(this);
  182. #else
  183. return soap_send_fault(this);
  184. #endif
  185. }
  186. #ifdef WITH_FASTCGI
  187. soap_destroy(this);
  188. soap_end(this);
  189. } while (1);
  190. #else
  191. } while (this->keep_alive);
  192. #endif
  193. return SOAP_OK;
  194. }
  195. static int serve___trp__GetServiceCapabilities(ReplayBindingService*);
  196. static int serve___trp__GetReplayUri(ReplayBindingService*);
  197. static int serve___trp__GetReplayConfiguration(ReplayBindingService*);
  198. static int serve___trp__SetReplayConfiguration(ReplayBindingService*);
  199. int ReplayBindingService::dispatch()
  200. { soap_peek_element(this);
  201. if (!soap_match_tag(this, this->tag, "trp:GetServiceCapabilities"))
  202. return serve___trp__GetServiceCapabilities(this);
  203. if (!soap_match_tag(this, this->tag, "trp:GetReplayUri"))
  204. return serve___trp__GetReplayUri(this);
  205. if (!soap_match_tag(this, this->tag, "trp:GetReplayConfiguration"))
  206. return serve___trp__GetReplayConfiguration(this);
  207. if (!soap_match_tag(this, this->tag, "trp:SetReplayConfiguration"))
  208. return serve___trp__SetReplayConfiguration(this);
  209. return this->error = SOAP_NO_METHOD;
  210. }
  211. static int serve___trp__GetServiceCapabilities(ReplayBindingService *soap)
  212. { struct __trp__GetServiceCapabilities soap_tmp___trp__GetServiceCapabilities;
  213. _trp__GetServiceCapabilitiesResponse trp__GetServiceCapabilitiesResponse;
  214. trp__GetServiceCapabilitiesResponse.soap_default(soap);
  215. soap_default___trp__GetServiceCapabilities(soap, &soap_tmp___trp__GetServiceCapabilities);
  216. if (!soap_get___trp__GetServiceCapabilities(soap, &soap_tmp___trp__GetServiceCapabilities, "-trp:GetServiceCapabilities", NULL))
  217. return soap->error;
  218. if (soap_body_end_in(soap)
  219. || soap_envelope_end_in(soap)
  220. || soap_end_recv(soap))
  221. return soap->error;
  222. soap->error = soap->GetServiceCapabilities(soap_tmp___trp__GetServiceCapabilities.trp__GetServiceCapabilities, &trp__GetServiceCapabilitiesResponse);
  223. if (soap->error)
  224. return soap->error;
  225. soap->encodingStyle = NULL;
  226. soap_serializeheader(soap);
  227. trp__GetServiceCapabilitiesResponse.soap_serialize(soap);
  228. if (soap_begin_count(soap))
  229. return soap->error;
  230. if (soap->mode & SOAP_IO_LENGTH)
  231. { if (soap_envelope_begin_out(soap)
  232. || soap_putheader(soap)
  233. || soap_body_begin_out(soap)
  234. || trp__GetServiceCapabilitiesResponse.soap_put(soap, "trp:GetServiceCapabilitiesResponse", "")
  235. || soap_body_end_out(soap)
  236. || soap_envelope_end_out(soap))
  237. return soap->error;
  238. };
  239. if (soap_end_count(soap)
  240. || soap_response(soap, SOAP_OK)
  241. || soap_envelope_begin_out(soap)
  242. || soap_putheader(soap)
  243. || soap_body_begin_out(soap)
  244. || trp__GetServiceCapabilitiesResponse.soap_put(soap, "trp:GetServiceCapabilitiesResponse", "")
  245. || soap_body_end_out(soap)
  246. || soap_envelope_end_out(soap)
  247. || soap_end_send(soap))
  248. return soap->error;
  249. return soap_closesock(soap);
  250. }
  251. static int serve___trp__GetReplayUri(ReplayBindingService *soap)
  252. { struct __trp__GetReplayUri soap_tmp___trp__GetReplayUri;
  253. _trp__GetReplayUriResponse trp__GetReplayUriResponse;
  254. trp__GetReplayUriResponse.soap_default(soap);
  255. soap_default___trp__GetReplayUri(soap, &soap_tmp___trp__GetReplayUri);
  256. if (!soap_get___trp__GetReplayUri(soap, &soap_tmp___trp__GetReplayUri, "-trp:GetReplayUri", NULL))
  257. return soap->error;
  258. if (soap_body_end_in(soap)
  259. || soap_envelope_end_in(soap)
  260. || soap_end_recv(soap))
  261. return soap->error;
  262. soap->error = soap->GetReplayUri(soap_tmp___trp__GetReplayUri.trp__GetReplayUri, &trp__GetReplayUriResponse);
  263. if (soap->error)
  264. return soap->error;
  265. soap->encodingStyle = NULL;
  266. soap_serializeheader(soap);
  267. trp__GetReplayUriResponse.soap_serialize(soap);
  268. if (soap_begin_count(soap))
  269. return soap->error;
  270. if (soap->mode & SOAP_IO_LENGTH)
  271. { if (soap_envelope_begin_out(soap)
  272. || soap_putheader(soap)
  273. || soap_body_begin_out(soap)
  274. || trp__GetReplayUriResponse.soap_put(soap, "trp:GetReplayUriResponse", "")
  275. || soap_body_end_out(soap)
  276. || soap_envelope_end_out(soap))
  277. return soap->error;
  278. };
  279. if (soap_end_count(soap)
  280. || soap_response(soap, SOAP_OK)
  281. || soap_envelope_begin_out(soap)
  282. || soap_putheader(soap)
  283. || soap_body_begin_out(soap)
  284. || trp__GetReplayUriResponse.soap_put(soap, "trp:GetReplayUriResponse", "")
  285. || soap_body_end_out(soap)
  286. || soap_envelope_end_out(soap)
  287. || soap_end_send(soap))
  288. return soap->error;
  289. return soap_closesock(soap);
  290. }
  291. static int serve___trp__GetReplayConfiguration(ReplayBindingService *soap)
  292. { struct __trp__GetReplayConfiguration soap_tmp___trp__GetReplayConfiguration;
  293. _trp__GetReplayConfigurationResponse trp__GetReplayConfigurationResponse;
  294. trp__GetReplayConfigurationResponse.soap_default(soap);
  295. soap_default___trp__GetReplayConfiguration(soap, &soap_tmp___trp__GetReplayConfiguration);
  296. if (!soap_get___trp__GetReplayConfiguration(soap, &soap_tmp___trp__GetReplayConfiguration, "-trp:GetReplayConfiguration", NULL))
  297. return soap->error;
  298. if (soap_body_end_in(soap)
  299. || soap_envelope_end_in(soap)
  300. || soap_end_recv(soap))
  301. return soap->error;
  302. soap->error = soap->GetReplayConfiguration(soap_tmp___trp__GetReplayConfiguration.trp__GetReplayConfiguration, &trp__GetReplayConfigurationResponse);
  303. if (soap->error)
  304. return soap->error;
  305. soap->encodingStyle = NULL;
  306. soap_serializeheader(soap);
  307. trp__GetReplayConfigurationResponse.soap_serialize(soap);
  308. if (soap_begin_count(soap))
  309. return soap->error;
  310. if (soap->mode & SOAP_IO_LENGTH)
  311. { if (soap_envelope_begin_out(soap)
  312. || soap_putheader(soap)
  313. || soap_body_begin_out(soap)
  314. || trp__GetReplayConfigurationResponse.soap_put(soap, "trp:GetReplayConfigurationResponse", "")
  315. || soap_body_end_out(soap)
  316. || soap_envelope_end_out(soap))
  317. return soap->error;
  318. };
  319. if (soap_end_count(soap)
  320. || soap_response(soap, SOAP_OK)
  321. || soap_envelope_begin_out(soap)
  322. || soap_putheader(soap)
  323. || soap_body_begin_out(soap)
  324. || trp__GetReplayConfigurationResponse.soap_put(soap, "trp:GetReplayConfigurationResponse", "")
  325. || soap_body_end_out(soap)
  326. || soap_envelope_end_out(soap)
  327. || soap_end_send(soap))
  328. return soap->error;
  329. return soap_closesock(soap);
  330. }
  331. static int serve___trp__SetReplayConfiguration(ReplayBindingService *soap)
  332. { struct __trp__SetReplayConfiguration soap_tmp___trp__SetReplayConfiguration;
  333. _trp__SetReplayConfigurationResponse trp__SetReplayConfigurationResponse;
  334. trp__SetReplayConfigurationResponse.soap_default(soap);
  335. soap_default___trp__SetReplayConfiguration(soap, &soap_tmp___trp__SetReplayConfiguration);
  336. if (!soap_get___trp__SetReplayConfiguration(soap, &soap_tmp___trp__SetReplayConfiguration, "-trp:SetReplayConfiguration", NULL))
  337. return soap->error;
  338. if (soap_body_end_in(soap)
  339. || soap_envelope_end_in(soap)
  340. || soap_end_recv(soap))
  341. return soap->error;
  342. soap->error = soap->SetReplayConfiguration(soap_tmp___trp__SetReplayConfiguration.trp__SetReplayConfiguration, &trp__SetReplayConfigurationResponse);
  343. if (soap->error)
  344. return soap->error;
  345. soap->encodingStyle = NULL;
  346. soap_serializeheader(soap);
  347. trp__SetReplayConfigurationResponse.soap_serialize(soap);
  348. if (soap_begin_count(soap))
  349. return soap->error;
  350. if (soap->mode & SOAP_IO_LENGTH)
  351. { if (soap_envelope_begin_out(soap)
  352. || soap_putheader(soap)
  353. || soap_body_begin_out(soap)
  354. || trp__SetReplayConfigurationResponse.soap_put(soap, "trp:SetReplayConfigurationResponse", "")
  355. || soap_body_end_out(soap)
  356. || soap_envelope_end_out(soap))
  357. return soap->error;
  358. };
  359. if (soap_end_count(soap)
  360. || soap_response(soap, SOAP_OK)
  361. || soap_envelope_begin_out(soap)
  362. || soap_putheader(soap)
  363. || soap_body_begin_out(soap)
  364. || trp__SetReplayConfigurationResponse.soap_put(soap, "trp:SetReplayConfigurationResponse", "")
  365. || soap_body_end_out(soap)
  366. || soap_envelope_end_out(soap)
  367. || soap_end_send(soap))
  368. return soap->error;
  369. return soap_closesock(soap);
  370. }
  371. /* End of server object code */