Hello,
I am trying to get started using the Clarizen API in .NET. I am using VS 2013. I have downloaded the ClarizenClient example to work from, but I am having a problem connecting to the API.
Following the steps from here: https://success.clarizen.com/hc/en-us/articles/205711818 I added a Web Refence to here: https://api.clarizen.com/v2.0/Clarizen.svc . When I did add the Service in Visual Studio, I got a warning saying "Do you want to view only the webpage content that was delivered securely?" I've tried answering both 'Yes' and 'No'. Either answer didn't seem to make a difference.
Running the ClarizenClient.exe that came with the downloaded sample, I am able to log into Clarizen and view my tasks. However I cannot seem to do the same with my basic example. When I get to the LoginResult line of the code, it hangs for a bit and then I get the error, "Unable to automatically step into the server. Connecting to the server machine api2.clarizen.com failed..."
Can you help provide some insight to what I am doing wrong?
Thank you.
Here's the code of my simple login test:
private void loginTest()
{
string userName;
string password;
userName = "MyUserName";
password = "MyPassword";
ClarizenSvc.Clarizen clarizenClient = new ClarizenSvc.Clarizen();
clarizenClient.Timeout = 60 * 1000;
//Enhance performance by compressing traffic
clarizenClient.EnableDecompression = true;
//Set your applicationId if applicable
LoginOptions options = new LoginOptions();
options.ApplicationId = "Sample c# client";
//Contact the login server to get the URL of your data center
GetServerDefinitionResult srvDef = clarizenClient.GetServerDefinition(userName, password, options);
//Change the SOAP client endpoint to use the new URL
clarizenClient.Url = srvDef.ServerLocation;
//Call the Login method
LoginResult lr = clarizenClient.Login(userName, password, options);
}