2013-07-21 45 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();