ws_ecl_client.ecm 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 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. #ifndef WS_ECL_CLIENT_API
  14. #define WS_ECL_CLIENT_API DECL_IMPORT
  15. #endif
  16. SCMenum WsEclClientRequestState
  17. {
  18. ESP_CLIENT_REQUEST_OK,
  19. ESP_CLIENT_REQUEST_CONNECTION_ERROR,
  20. ESP_CLIENT_REQUEST_NORMAL_ERROR
  21. };
  22. // IClientHeaderFileSearchResp is used to access the result set of the query
  23. //
  24. SCMInterface IClientWsEclResp(IInterface)
  25. {
  26. unsigned long getRequestId();
  27. unsigned long getClientValue();
  28. WsEclClientRequestState getRequestState();
  29. const char *getResultsXML();
  30. const char *getSoapMessage();
  31. const char *getStatusMessage(StringBuffer &message);
  32. const char *getHttpMessage(StringBuffer &message);
  33. };
  34. // IClientHeaderFileSearchRequest is used to set up a simple ECL query
  35. //
  36. /*
  37. SCMInterface IClientWsEclRequest(IInterface)
  38. {
  39. void setUrl(const char* URL);
  40. void setClientValue(unsigned long cv);
  41. void addTag(const char* name, const char *value);
  42. void addIntTag(const char* name, int value);
  43. void addArray(const char *name, StringArray &array);
  44. bool hasTag(const char* name);
  45. void addDataset(const char *name, const char *ds);
  46. };
  47. */
  48. SCMInterface IClientRequestNode(IInterface)
  49. {
  50. void addTag(const char* name, const char *value);
  51. void addIntTag(const char* name, int value);
  52. void setTag(const char* name, const char *value); //will overwrite the tag if it already exists.
  53. bool hasTag(const char* name);
  54. void addAttr(const char* name, const char* value);
  55. IClientRequestNode& addChild(const char* name);
  56. IClientRequestNode& addChild(const char* name, const char* value);
  57. void addDataset(const char *name, const char *ds);
  58. };
  59. SCMInterface IClientWsEclRequest(IClientRequestNode)
  60. {
  61. void setUrl(const char* URL);
  62. void setNamespace(const char* ns);
  63. void setNamespaceVar(const char* nsvar);
  64. void setSoapAction(const char* action);
  65. void setClientValue(unsigned long cv);
  66. void addArray(const char *name, StringArray &array);
  67. // Some server can not handle security header
  68. void setNoSecurityHeader(bool noHeader);
  69. void setSpecialMethod(const char* method);
  70. void disableKeepAlive();
  71. const char* getSerializedContent();
  72. void setSerializedContent(const char* c);
  73. void setItemTag(const char * tag);
  74. IClientRequestNode& addHeader(const char* name, const char* ns);
  75. void appendSerializedContent(const char * c);
  76. };
  77. /*
  78. SCMInterface IClientWsEclRequest(IInterface)
  79. {
  80. // from IClientRequestNode
  81. void addTag(const char* name, const char *value);
  82. void addIntTag(const char* name, int value);
  83. bool hasTag(const char* name);
  84. void addAttr(const char* name, const char* value);
  85. IClientRequestNode& addChild(const char* name);
  86. IClientRequestNode& addChild(const char* name, const char* value);
  87. void addDataset(const char *name, const char *ds);
  88. // more
  89. void setUrl(const char* URL);
  90. void setNamespace(const char* ns);
  91. void setSoapAction(const char* action);
  92. void setClientValue(unsigned long cv);
  93. void addArray(const char *name, StringArray &array);
  94. // Some server can not handle security header
  95. void setNoSecurityHeader(bool noHeader);
  96. };
  97. */
  98. SCMinterface IClientWsEclEvents(IInterface)
  99. {
  100. int onComplete(IClientWsEclResp &resp);
  101. int onError(IClientWsEclResp &resp);
  102. };
  103. SCMInterface IClientWsEclService(IInterface)
  104. {
  105. void addServiceUrl(const char * url);
  106. void removeServiceUrl(const char *url);
  107. const char* queryServiceUrl();
  108. IClientWsEclRequest* createRequest(const char *methodName);
  109. IClientWsEclResp* search(IClientWsEclRequest* request);
  110. void searchAsync(IClientWsEclRequest* request, IClientWsEclEvents &events);
  111. IClientWsEclResp* searchEx(IClientWsEclRequest* request, const char *user, const char *pw, const char *relm);
  112. IClientWsEclResp* searchEx(IClientWsEclRequest* request,const char* URL, const char *user, const char *pw, const char *relm);
  113. IClientWsEclResp* sendHttpRequest(IClientWsEclRequest* request, const char* method, const char* URL,
  114. const char *user, const char *pw, const char *realm, const char* httpPostVariableName,
  115. bool encodeHttpPostBody);
  116. };
  117. extern "C" WS_ECL_CLIENT_API IClientWsEclService * getWsEclClient();
  118. extern "C" WS_ECL_CLIENT_API IClientWsEclService * createWsEclClient();
  119. SCMclarion
  120. map
  121. module('instant ecl client')
  122. createWsEclClient procedure, *cppClientWsEclService, pascal, raw, name('_createWsEclClient@0')
  123. end
  124. end
  125. SCMend