Forum Discussion

jamar's avatar
jamar
Ideator III
9 years ago

Error connecting to ARAS through C# application

Hello, Apologies for the 3rd post in 3 days. Using the below snippet of code it should allow me to log in to the system (through set credentials or windows authorisation) . string url = "http://Server/Database string db = "Database"; string user = "admin"; string pw = "innovator"; HttpServerConnection conn = IomFactory.CreateHttpServerConnection(url, db, user, pw); //WinAuthHttpServerConnection conn = IomFactory.CreateWinAuthHttpServerConnection(url, db); Item login_result = conn.Login(); if (login_result.isError()) throw new Exception("Login failed"); Innovator inn = IomFactory.CreateInnovator(conn); For some reason this was working Wednesday but stopped working overnight. The error I get with visual studio is: "System.Net.WebException: Unable to connect to remote server" Fault Code - 999 Fault string - HTTP Error Fault factor - HTTP Server Connection Detail - Unknown error I have tried: Login using both sets of login information on all installed browsers via the log in page  - works fine Confirmed the login.aspx page has anonymous login disabled. Confirmed VS takes the raw password string and converts into a password hash. I can connect in via AML Studio 1.2 using the same information Can anyone confirm if I am doing something wrong, or provide some insight as to why I cannot connect? I can provide screenshots of VS if needed but not sure how to add them, if I can. Thanks in advance James      

4 Replies

  • Hummm... I would have said it has to do with .net framework. But I could be sure about what actually changed overnight for you. As it was working, it is hard to tell what may have changed. It should be the right way to do it. Any update since your post?
  • jamar's avatar
    jamar
    Ideator III
    Thanks for your feedback. I have today done the following:
    1. Copied the code to a new project (unsaved), ran it and it works fine (multiple times)
    2. Saved the project (to my standard projects folder), ran it (in debug mode) and it fails.
    3. Cleaned the build (Build -> Clean), then rebuilt ran it and it fails.
    It only seems to work on unsaved projects. I am using .net framework 4.5. I am not using a logout / disconnect in the code as I don't know how to do it. would this have any impact?  
  • Former Member's avatar
    Former Member
    Not applicable
    Any update on this as I also getting login issue. My error says "Authentication Failed to <Myusername>". I am using below code and I have deployed the code in IIS: string serverAddress = "">http://server/Innovator/"; string database = "Innovator"; string userName = "myid"; string password = "pwd"; HttpServerConnection conn = IomFactory.CreateHttpServerConnection(serverAddress, database, userName, password); Item login_result = conn.Login(); if (login_result.isError()) throw new Exception("Login failed");   But I am unable to login....
  • Former Member's avatar
    Former Member
    Not applicable
    Solved by passing the default credentials.