tomsedison - Saturday, August 18, 2007 11:05 AM:
Hi,
I am trying to access the items in Innovator from my custom application, I am getting 'Request time out' error.
My actual requirement is to upload and download files into vault. This has to be done from an external application.
When I looked into IIS log for the InnovatorSolutions website I found HTTP 405 error.
Please let me know where I have gone wrong? Is it not possible to access the Innovator objects from external applications?
This is what I did:
I created a windows application in VS2005/C# and included IOM.dll file to the references of my application.
Included namespaces "IOM" and IOME" to my project.
Following is the code block which I tried
private void Execute()
{
IOM.HTTPServerConnection conn = new HTTPServerConnection();
conn.http_username = "admin";
conn.http_password = "innovator";
conn.http_database = "InnovatorSolutions";
conn.innovator_server_url = @"MyMachine:8880/InnovatorServer";
conn.vault_server_url = @"MyMachine:8880/.../";
try
{
Innovator obj = new Innovator(conn);
Item item = obj.getItemByKeyedName("File", "file.jpg");
LogMessage(item.getID());
return;
}
catch (Exception ex)
{
LogMessage(ex.Message);
}
finally
{
conn.Close();
}
}
Thanks in advance
Toms
snnicky - Sunday, August 26, 2007 2:20 AM:
Hello Toms,Innovator Server and Innovator Vault URLs must be full specified.
For example "">MyMachine:8880/.../InnovatorServer.aspx" and "">MyMachine:8880/.../VaultServer.aspx".
405 HTTP error means "Directory listing is denied".
Also as far as I remember password must be MD5 encoded. Not just plain "innovator".
Hope this helps.
prasad - Friday, May 11, 2012 6:18 AM:
Hello tomsedison,
Yes, It is possible to access Innovator objects from external applications.
Try creating HttpServerConnection using following code:
- - - - - - - - - - - - - - - - - - - - -
HttpServerConnection conn = IomFactory.CreateHttpServerConnection(url, database, username, password);
Item login_result = conn.Login();
if (login_result.isError())
{
throw new Exception("Login failed");
}
- - - - - - - - - - - - - - - - - - - - -
value of url must be "MyMachine/.../InnovatorServer.aspx";
To Upload a file in ARAS use:
- - - - - - - - - - - - - - - - - - - - -
Innovator inn=new Innovator(conn);
Item New_File = inn.newItem("File", "add");
New_File.setProperty("filename", <name of file>);
New_File.setProperty("checkedout_path", "C:\");
try {
New_File.attachPhysicalFile(path); //path will be actual physical path containing file name with extension.
}
catch (Exception e) {
return "file_error: " + path;
}
Item res = New_File.apply();
- - - - - - - - - - - - - - - - - - - - -
To Download a file Use:
- - - - - - - - - - - - - - - - - - - - -
Item file1 = inn.newItem("File", "get");
file1.setProperty("id", file_id1);
Item res1 = file1.apply();
Item File = res1.getItemByIndex(0);
File.checkout("C:\");
- - - - - - - - - - - - - - - - - - - - -
File will get downloaded to C:
Cheers,
Prasad
aknourenko - Monday, May 21, 2012 5:29 PM:
I believe only vault URL must be fully specified; Innovator Server URL that is specified for logging in could be either partial (e.g. MyMachine:8880/InnovatorServer) or full (e.g. MyMachine:8880/.../InnovatorServer.aspx) - in case partial URL is specified the "Server/InnovatorServer.aspx" is appended automatically. Password also could be either plain text (in which case it's MD5 encoded before passing to the server) or MD5 value (in which case it's passed as-is).