Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: TRESTClient throws EBindingScopeFactoryError



Permlink Replies: 1 - Last Post: Sep 27, 2017 9:15 PM Last Post By: Greg Reese Threads: [ Previous | Next ]
Dhaval Panchal

Posts: 1
Registered: 10/21/17
TRESTClient throws EBindingScopeFactoryError
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 26, 2017 6:32 AM
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 <vcl.h>
#include <REST.Client.hpp>
#include <REST.Authenticator.OAuth.hpp>
#include <IpPeerClient.hpp>

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'.
Greg Reese

Posts: 75
Registered: 7/15/05
Re: TRESTClient throws EBindingScopeFactoryError
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 27, 2017 9:13 PM   in response to: Dhaval Panchal in response to: Dhaval Panchal
Dhaval Panchal wrote:
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,
Pr [this thread|https://forums.embarcadero.com/message.jspa?messageID=846693#846693] oject Project1.exe raised exception class EBindingScopeFactoryError with message 'Scope class TBindSourceAdapterCustomScope not registered'.

Other people and I have had a similar problem. Although we never figured out the cause or a good solution, you might find some helpful information in
the thread at https://forums.embarcadero.com/message.jspa?messageID=846693#846693

Greg Reese

Edited by: Greg Reese on Sep 27, 2017 9:13 PM - didn't get link to thread in
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02