function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
satyaprakash palsatyaprakash pal 

SOAP webservice Login functionality

I wrote one SOAP webservice Class and I have created one connected app. I want to write login functionality in SOAP webservice.
I am using connected app for authentication.

I used below login code but it's showing Error: Compile Error: Invalid type: ConnectorConfig. error.

ConnectorConfig config = new ConnectorConfig();
config.setManualLogin(true);
EnterpriseConnection sforceConnection = Connector.newConnection(config);
sforceConnection.setLoginScopeHeader(ORGANIZATIONID, PORTALID);
LoginResult loginResult = sforceConnection.login(username, password);
config.setServiceEndpoint(loginResult.getServerUrl());
sforceConnection.setSessionHeader(loginResult.getSessionId()); 


Lars NielsenLars Nielsen
Would you mind pasting or attaching the entire class in there. It will be much quicker to debug. Also, if you can attach the WSDL that would be helpful...Thx
VineetKumarVineetKumar
What I think is that ConnectorConfig is not a stand alone class.
ConnectorConfig config = new ConnectorConfig(); 

If it is a part of some other other class, maybe you will have to refer it as
<ClassName>.ConnectorConfig config = new <ClassName>.ConnectorConfig();

This info you can get from the WSDL that you have consumed, by referring the stub classes that got created.