123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- /*##############################################################################
- HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ############################################################################## */
- #ifndef WS_ECL_CLIENT_API
- #define WS_ECL_CLIENT_API DECL_IMPORT
- #endif
- SCMenum WsEclClientRequestState
- {
- ESP_CLIENT_REQUEST_OK,
- ESP_CLIENT_REQUEST_CONNECTION_ERROR,
- ESP_CLIENT_REQUEST_NORMAL_ERROR
- };
- // IClientHeaderFileSearchResp is used to access the result set of the query
- //
- SCMInterface IClientWsEclResp(IInterface)
- {
- unsigned long getRequestId();
- unsigned long getClientValue();
-
- WsEclClientRequestState getRequestState();
- const char *getResultsXML();
- const char *getSoapMessage();
- const char *getStatusMessage(StringBuffer &message);
- const char *getHttpMessage(StringBuffer &message);
- };
- // IClientHeaderFileSearchRequest is used to set up a simple ECL query
- //
- /*
- SCMInterface IClientWsEclRequest(IInterface)
- {
- void setUrl(const char* URL);
- void setClientValue(unsigned long cv);
- void addTag(const char* name, const char *value);
- void addIntTag(const char* name, int value);
- void addArray(const char *name, StringArray &array);
- bool hasTag(const char* name);
- void addDataset(const char *name, const char *ds);
- };
- */
- SCMInterface IClientRequestNode(IInterface)
- {
- void addTag(const char* name, const char *value);
- void addIntTag(const char* name, int value);
- void setTag(const char* name, const char *value); //will overwrite the tag if it already exists.
- bool hasTag(const char* name);
- void addAttr(const char* name, const char* value);
- IClientRequestNode& addChild(const char* name);
- IClientRequestNode& addChild(const char* name, const char* value);
- void addDataset(const char *name, const char *ds);
- };
- SCMInterface IClientWsEclRequest(IClientRequestNode)
- {
- void setUrl(const char* URL);
- void setNamespace(const char* ns);
- void setNamespaceVar(const char* nsvar);
- void setSoapAction(const char* action);
- void setClientValue(unsigned long cv);
- void addArray(const char *name, StringArray &array);
- // Some server can not handle security header
- void setNoSecurityHeader(bool noHeader);
- void setSpecialMethod(const char* method);
- void disableKeepAlive();
- const char* getSerializedContent();
- void setSerializedContent(const char* c);
- void setItemTag(const char * tag);
- IClientRequestNode& addHeader(const char* name, const char* ns);
- void appendSerializedContent(const char * c);
- };
- /*
- SCMInterface IClientWsEclRequest(IInterface)
- {
- // from IClientRequestNode
- void addTag(const char* name, const char *value);
- void addIntTag(const char* name, int value);
- bool hasTag(const char* name);
- void addAttr(const char* name, const char* value);
- IClientRequestNode& addChild(const char* name);
- IClientRequestNode& addChild(const char* name, const char* value);
- void addDataset(const char *name, const char *ds);
- // more
- void setUrl(const char* URL);
- void setNamespace(const char* ns);
- void setSoapAction(const char* action);
- void setClientValue(unsigned long cv);
- void addArray(const char *name, StringArray &array);
- // Some server can not handle security header
- void setNoSecurityHeader(bool noHeader);
- };
- */
- SCMinterface IClientWsEclEvents(IInterface)
- {
- int onComplete(IClientWsEclResp &resp);
- int onError(IClientWsEclResp &resp);
- };
- SCMInterface IClientWsEclService(IInterface)
- {
- void addServiceUrl(const char * url);
- void removeServiceUrl(const char *url);
- const char* queryServiceUrl();
- IClientWsEclRequest* createRequest(const char *methodName);
-
- IClientWsEclResp* search(IClientWsEclRequest* request);
- void searchAsync(IClientWsEclRequest* request, IClientWsEclEvents &events);
- IClientWsEclResp* searchEx(IClientWsEclRequest* request, const char *user, const char *pw, const char *relm);
- IClientWsEclResp* searchEx(IClientWsEclRequest* request,const char* URL, const char *user, const char *pw, const char *relm);
- IClientWsEclResp* sendHttpRequest(IClientWsEclRequest* request, const char* method, const char* URL,
- const char *user, const char *pw, const char *realm, const char* httpPostVariableName,
- bool encodeHttpPostBody);
- };
- extern "C" WS_ECL_CLIENT_API IClientWsEclService * getWsEclClient();
- extern "C" WS_ECL_CLIENT_API IClientWsEclService * createWsEclClient();
- SCMclarion
- map
- module('instant ecl client')
- createWsEclClient procedure, *cppClientWsEclService, pascal, raw, name('_createWsEclClient@0')
- end
- end
- SCMend
|