Open GoogleCodeExporter opened 9 years ago
You can set partnerConfig.setManualLogin(true) and do the login call your self.
This will return the LoginResult object from which you can get the metadata URL.
HTHs,
manoj
Original comment by manoj.ch...@gmail.com
on 21 Mar 2011 at 6:40
I see - I didn't see that in the Wiki docs - thanks. In any case, I tried
manual login and I'm still having an "INVALID SESSION" issue. So is the
auto-login doing other stuff besides resetting end points?
Here's my code that doesn't work. (my original hack, above, continues to work)
ConnectorConfig partnerConfig = new ConnectorConfig();
ConnectorConfig metadataConfig = new ConnectorConfig();
/*partnerConfig.setUsername(USERNAME);
partnerConfig.setPassword(PASSWORD);
*/
partnerConfig.setManualLogin(true);
PartnerConnection partnerConnection =
com.sforce.soap.partner.Connector.newConnection(partnerConfig);
LoginResult result = partnerConnection.login(USERNAME, PASSWORD);
partnerConfig.setServiceEndpoint(result.getServerUrl());
metadataConfig.setServiceEndpoint(result.getMetadataServerUrl());
metadataConfig.setSessionId(
partnerConnection.getSessionHeader().getSessionId());
MetadataConnection conn = Connector.newConnection(metadataConfig);
ListMetadataQuery query = new ListMetadataQuery();
query.setType("CustomObject");
double asOfVersion = 21.0;
ListMetadataQuery [] queries = { query };
FileProperties[] lmr = conn.listMetadata(queries, asOfVersion);
Original comment by cw10...@gmail.com
on 21 Mar 2011 at 8:22
yes, auto login will reset the endpoint as well as the session id.
Original comment by manoj.ch...@gmail.com
on 21 Mar 2011 at 8:30
Ok, but the manual login code doesn't work. As you can see from the above
listed code, I'm manually resetting the endpoints and session, but it fails
with INVALID_SESSION_ID. I have to continue to use auto-login and the hack I
show in the initial issue entry here...
Original comment by cw10...@gmail.com
on 21 Mar 2011 at 8:44
Original issue reported on code.google.com by
cw10...@gmail.com
on 21 Mar 2011 at 6:07