resolution for "the url returned from login must be set in the sforceservice "


EnterpriseConnection connection = new enterpriseConnection();
loginResult = connection.login(userName, Password);
System.out.println("Succesfully logged IN");
connection._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,loginResult.getServerUrl());
SessionHeader sessionHdr = new SessionHeader();
sessionHdr.setSessionId(loginResult.getSessionId());
connection.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),"SessionHeader", sessionHdr);

1 comment: