ws_dfsplugin.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2022 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #pragma warning (disable : 4786)
  14. #include "ws_dfs_esp.ipp"
  15. //ESP Bindings
  16. #include "http/platform/httpprot.hpp"
  17. //ESP Service
  18. #include "ws_dfsservice.hpp"
  19. #include "espplugin.hpp"
  20. extern "C"
  21. {
  22. //when we aren't loading dynamically
  23. // Change the function names when we stick with dynamic loading.
  24. ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
  25. {
  26. if (strieq(type, "ws_dfsservice"))
  27. {
  28. CWsDfsEx* service = new CWsDfsEx;
  29. service->init(cfg, process, name);
  30. return service;
  31. }
  32. return nullptr;
  33. }
  34. ESP_FACTORY IEspRpcBinding* esp_binding_factory(const char* name, const char* type, IPropertyTree* cfg, const char* process)
  35. {
  36. //binding names of the form <servicetype>_http are being added so the names can be made more consistent and can therefore be automatically generated
  37. // the name also better reflects that these bindings are for all HTTP based protocols, not just SOAP
  38. // both "SoapBinding" and "_http" names instantiate the same objects.
  39. if (strieq(type, "ws_dfsserviceSoapBinding") || strieq(type, "WsDfs_http"))
  40. {
  41. return new CWsDfsSoapBinding(cfg, name, process);
  42. }
  43. return nullptr;
  44. }
  45. ESP_FACTORY IEspProtocol * esp_protocol_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
  46. {
  47. return http_protocol_factory(name, type, cfg, process);
  48. }
  49. };