Forums > SpiraTeam Forums > SpiraTeam Issues & Questi... > Remote Access using API
I am trying to connect for the first time to Spirateam from a Visual Studio .NET test project using the following code
bool result = connection.Connection_Authenticate("username", "password");
RemoteProject  projects = connection.Project_Retrieve();
foreach( RemoteProject project in projects)
I get the connection ok to my test environment. Connection_Authenticate returns true but the call to Project_Retreive() fails with the following error.
"The session was not authenticated, please call the Connection_Authenticate() method first"
But as you can see I have called the Connection Authenticate successfully.
There are projects in the SPirateam instance associated to this user.
Any suggestions on hoe to see what the error could be?
Below is the autogenerated config file.
ImportExportClient connection = new ImportExportClient();connection.CookieContainer = new CookieContainer();
This creates the storage for cookies, so that on the next request (getting list of projects) the cookies are returned and the system knows you're logged on.
Also, I don't see you checking the result - be sure that 'result' is true, or else you really weren't logged on.
Also since you're using WCF web services, an even easier way would be to simply change:
in your .config file and that will fix the issue.
results match your keyword(s)