2013-07-21 48 views
0

我從Salesforce收到了需要附加到SOAP頭中的合作伙伴令牌,我正在使用以下代碼來驗證有效會話,但我不確定我在哪裏需要追加伴侶令牌。以下是我在Java中的代碼。GE/PE將合作伙伴令牌添加到clientId以進行SOAP調用Salesforce

ConnectorConfig config = new ConnectorConfig(); config.setAuthEndpoint(「https://login.salesforce.com/services/Soap/c/24.0/」); config.setServiceEndpoint(salesforceUserCredentials.getServerURL()); config.setSessionId(salesforceUserCredentials.getSessionId()); connection = new EnterpriseConnection(config); logger.info(「連接狀態:」+連接);

GetUserInfoResult userInfo = connection.getUserInfo();

回答

1

Partner Token設置在CallOption.client字段中。

在您的示例代碼猜測:

connection = new EnterpriseConnection(config); 

connection.CallOptionsValue = new CallOptions(); 
connection.CallOptionsValue.client = "YourPartnerToken/"; 

logger.info("Connection Status: "+connection); 
GetUserInfoResult userInfo = connection.getUserInfo();