Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

TRESTClient throws EBindingScopeFactoryError

$
0
0

I have created new console application of C++ Builder Type. My requirement is to achieve REST API Request from DLL without any UI. With some research I found TREST library. But it requires VCL library. So I Just added new VCL form in Project it will ask you to enable VCL framework in project if not added Although I have not used this form anywhere in project as I need to implement Web Service Call without UI.
Now in here is my code,

 

#include 
#include 
#include 
#include 

int _tmain(int argc, _TCHAR* argv[])
{

System::UnicodeString inputXMLStringUnicode = "";
System::UnicodeString ABaseApiURL = "";
System::UnicodeString consumerKeyUnicode = ""; System::
UnicodeString consumerSecretUnicode = "";
System::UnicodeString signingClass = "";

TOAuth1Authenticator *Auth1Authenticator2 = new TOAuth1Authenticator(NULL);
Auth1Authenticator2->ConsumerKey = consumerKeyUnicode;
Auth1Authenticator2->ConsumerSecret = consumerSecretUnicode;
Auth1Authenticator2->SigningClassName = signingClass;

TRESTClient *RESTClient2 = new TRESTClient(ABaseApiURL);
TRESTRequest *RESTRequest2 = new TRESTRequest(RESTClient2);
TRESTResponse *RESTResponse2 = new TRESTResponse(NULL);
RESTRequest2->Client = RESTClient2;
RESTRequest2->Response = RESTResponse2;
RESTRequest2->Method = rmPOST;
RESTRequest2->AddBody(inputXMLStringUnicode, ctAPPLICATION_XML);
Auth1Authenticator2->Authenticate(RESTRequest2);

RESTRequest2->Execute();
AnsiString ansiConverted = RESTResponse2->Content;
string response = ansiConverted.c_str();

return 0;

}

 

When we run this app, It will make successful web service call. But after all code execution completes, after return statement, it throws below exception,

Project Project1.exe raised exception class EBindingScopeFactoryError with message 'Scope class TBindSourceAdapterCustomScope not registered'.


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>