You need to sign in to do that
Don't have an account?
spuish
Partner WSDL API: error trying to access User object
I am having trouble access the User object when I use the SessionId and Url to create a SforceService object. If I hard code the username and password to create the SforceService, it works fine. Here is the code:
*************** Works ***************
binding = new SforceService();
sforcep.LoginResult lr = binding.login("sarah@citenet.net", "xxxxxxx");
binding.SessionHeaderValue = new SessionHeader();
binding.SessionHeaderValue.sessionId = lr.sessionId;
binding.Url = lr.serverUrl;
QueryResult qr = binding.query("select UserName, LastName, FirstName, Id from User");
sObject[] users = qr.records; <-- HAS RECORDS
*************** Does Not Work ***************
APISessionID = Request.QueryString["sid"];
APIUrl = Request.QueryString["url"];
this.binding = PyrotoScheduler.SalesForce.salesforce.GetBinding(this.APISessionID, this.APIUrl);
QueryResult qr = binding.query("select UserName, LastName, FirstName, Id from User");
sObject[] users = qr.records; <-- EMPTY
Can someone shed some light on this?
Thanks!
--Sarah
*************** Works ***************
binding = new SforceService();
sforcep.LoginResult lr = binding.login("sarah@citenet.net", "xxxxxxx");
binding.SessionHeaderValue = new SessionHeader();
binding.SessionHeaderValue.sessionId = lr.sessionId;
binding.Url = lr.serverUrl;
QueryResult qr = binding.query("select UserName, LastName, FirstName, Id from User");
sObject[] users = qr.records; <-- HAS RECORDS
*************** Does Not Work ***************
APISessionID = Request.QueryString["sid"];
APIUrl = Request.QueryString["url"];
this.binding = PyrotoScheduler.SalesForce.salesforce.GetBinding(this.APISessionID, this.APIUrl);
QueryResult qr = binding.query("select UserName, LastName, FirstName, Id from User");
sObject[] users = qr.records; <-- EMPTY
Can someone shed some light on this?
Thanks!
--Sarah
--Sarah