function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
muthuswimuthuswi 

Problem getting data in partner wsdl!!!

Hi
 
I am using partner wsdl (production), .net framework 1.1, and C#. I am changing sforce.binding.url dynamically  to https://test.salesforce.com/services/Soap/c/8.0 to connect to sandbox instance. Login works fine but I am not getting any data from any of the entities thro' api calls. Can't I use partner wsdl (non sandbox) to connect both the instances (sandbox and production)? What could be the possible way to connect to both instances using a single wsdl? Is it possible?
 
Here is sample code:
 
if (sandBox == true)
               binding.Url = @"https://test.salesforce.com/services/Soap/c/8.0";
else
               binding.Url = @"https://www.salesforce.com/services/Soap/c/7.0";
 
Can anyone help me on this?
 
Thanks in advance.
 
Muthu.

Message Edited by muthuswi on 12-28-2006 12:14 PM

SuperfellSuperfell
How does it not work? why do you use the 8.0 api on sandbox instead of 7.0 (which is what your wsdl version is). ?
muthuswimuthuswi
Hi,
 
I just tried both versions, I am getting same result even when I use               
 
 
Login works fine....but no data.
 
Thanks.
 
Muthu.
SuperfellSuperfell
what do you mean by "no data" you have a query that returns no rows? you've checked in the UI that some rows exist for that query ? what's the query ?
muthuswimuthuswi
Hi,
 
Here is my sample query:
 
Login:
 bool sandBox = true;
 SforceService binding = new SforceService();
 if (sandBox)
  binding.Url = @"https://test.salesforce.com/services/Soap/c/7.0";
 else
  binding.Url = @"https://www.salesforce.com/services/Soap/u/7.0";

 LoginResult _loginResult = binding.login(userid, password);
 binding.SessionHeaderValue = new SessionHeader();
 binding.SessionHeaderValue.sessionId = _loginResult.sessionId;
 binding.Url = _loginResult.serverUrl;

Retrieve Date:

 string qryTask = "select Id from Task";
 QueryResult oResult = binding.query(qryTask);
 
//this query returns no rows in sandbox...but i have data in the entity Task.*****************************
 
 for (int i = 0; i< oResult.size; i++)
 {  
  Console.WriteLine(oResult.records[i].Id.ToString());
 }
 
Thanks
 
Muthu.
SuperfellSuperfell
Your URL is wrong for test, look at the ending you have /c/7.0, should be /u/7.0 like the www one.
muthuswimuthuswi

Yes. It works.

Thanks a lot Simon.

Muthu.