+ Start a Discussion
yajivyajiv 

Use wsc to access Salesforce using a Customer Portal login-setting orgid and portalId somewhere ?

I have been trying to use wsc to access Salesforce using a Customer Portal login. I don’t see a place to put in the orgId and portalId to be able to log into Salesforce as is provided by for example the Flex for Force code.

 

Connection.organizationId = Parameters.orgid;

Connection.portalId = Parameters.portalid;

 

Is there a way I can log into Salesforce for a Customer Portal user ?

 

I am able to log in fine for a normal Salesforce user but not for a Customer Portal user.

 

Is there a ConnectorConfig.set...  to set the org and portalid similar to what the Flex for force code does to login a Customer Portal user ?

 

I am also using the Enteprise wsdl.

 

TIA,

Vijay

yajivyajiv

I have boiled it down to the following:

How do i set the EnterpriseConnection.setLoginScopeHeader(orgId,PortalId) before the new EnterpriseConnection(ConnectionConfig) gets called ?

 

I am also not sure if I have to use Enterrpise wsdl or partner wsdl when i am trying to login as a Customer Portal user ?

 

TIA,

Vijay

gnasagnasa

yajiv, thanx for the pointer..

I am also trying to use wsc to access Salesforce using a Customer Portal login,

and did it in following way.

 

ConnectorConfig config = new ConnectorConfig();

config.setManualLogin(true);

try {

connection = Connector.newConnection(config);

connection.setLoginScopeHeader("orgId", "portalId");

LoginResult loginResult = connection.login("UserName", "Password");

config.setServiceEndpoint(loginResult.getServerUrl());

connection.setSessionHeader(loginResult.getSessionId());

 

// conection step completed manually..

} catch (ConnectionException e) {

e.printStackTrace();

}

 

Thank You

gnasa