我正在查看一些使用Salesforce SOAP API创建会话和访问数据的代码:
SoapBindingStub binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
String username;
String password;
[...]
LoginResult result = binding.login(username, password);
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,result.getServerUrl());
SessionHeader sh = new SessionHeader();
sh.setSessionId(result.getSessionId());
binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);
鉴于我有一个OAuth访问令牌和端点,有没有办法让它在没有用户名/密码的情况下正常工作?
答案 0 :(得分:1)
经过批次的反复试验 - 答案似乎如下
https://na15.salesforce.com/services/Soap/u/21.0