I am building a Java application to interact with the different api's Salesforce provides such as Tooling Api, Metadata Api, Partner Api. I have several questions:
Is it possible to make the application log into any Salesforce Org and use the Tooling Api / Metadata Api for that org ? I know that Partner Api should be ok with that.
I was able to use the Tooling Api with the following approach:
ConnectorConfig toolingConfig = new ConnectorConfig (); toolingConfig.setServiceEndpoint(...) toolingConfig.setSessionId(loginResult.getSessionId()); ToolingConnection soapConnection = new ToolingConnection(toolingConfig);
ConnectorConfig object is provided by the WSC.
ToolingConnection object is provided by the Tooling WSDL.
Is it the right way to use my org's Tooling API WSDL to connect (using username and password) to other Salesforce organizations as well?