0
我在看它是使用Salesforce的SOAP API來創建一個會話,訪問數據的一些代碼:使用OAuth與SforceServiceLocator
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訪問令牌和終點,是有沒有一種方法來適應這個沒有用戶名/密碼正確工作?