This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - can not login using IOM.dll after upgrading PLM from 8.1 to 9.2

rammsh - Wednesday, January 26, 2011 11:28 AM:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hi,

We 've recently upgraded our Aras PLM from 8.1.1 to 9.2, we also have an .net web application (that we've developped) wich uses the IOM.dll version 8.1.

1.Here is the code i used to use in order to login to PLM (and it used to work properly with IOM.dll version 8.1):

Dim

 

 

Conn = New IOM.HTTPServerConnection()

Conn.innovator_server_url =

 

"MyServer/.../InnovatorServer.aspx"

Conn.http_username = TextBox1.Text.Trim()

Conn.http_password = IOM.Innovator.ScalcMD5(TextBox2.Text.Trim())

Conn.http_database =

 

"databaseProd"

 

 

 

Dim Inn As IOM.Innovator = New IOM.Innovator(Conn)

 

 

 

Dim MyItem As IOM.Item = Inn.newItem("User", "get")

MyItem.setAttribute(

 

"select", "first_name,last_name")

MyItem.setProperty(

 

"login_name", TextBox1.Text.Trim())

 

 

 

Dim MyResult As IOM.Item = MyItem.apply()

 

 

 

If MyResult.isError() Then

 

 

 

     If MyResult.getErrorDetail().Contains("Authentication failed") Then

          Response.Write(

 

"<script>alert('Wrong Username or Password !');</script>")

 

 

 

     Else

          Response.Write(

 

"<script>alert('" + MyResult.getErrorDetail() + "');</script>")

 

 

 

     End If

 

 

 

     Return

 

 

 

End If

Session(

 

"UserFullName") = MyResult.getProperty("first_name") + " " + MyResult.getProperty("last_name") --->

the error is here (when trying to getProperty()) and the error message says "Not an Item"

Response.Redirect(

 

"MyPage.aspx")

...

2.Here is what I 've tried with the new IOM.dll version 9.2 according to the Developpers Doc

Dim

 

 

strInnovatorServer As String = "MyServer/.../InnovatorServer.aspx"

 

 

 

Dim conn As HttpServerConnection

conn = IomFactory.CreateHttpServerConnection(strInnovatorServer,

 

"databaseProd", TextBox1.Text.Trim(), Innovator.ScalcMD5(TextBox2.Text.Trim()))

 

 

 

Dim login_result As Item = conn.Login()

 

 

 

If login_result.isError() Then --->isError() = true, it looks like i'm not logged in properly

    Response.Write(

 

"<script>alert('" + login_result.getErrorDetail() + "');</script>") --->getErrorDetail() is empty

    conn.Logout()

 

 

 

    Return

 

 

 

End If

 

 

 

Dim Inn As Innovator = IomFactory.CreateInnovator(conn)

Note: if

3.Note: if I run the code below, I receive an error message: "The Database is not available".

Dim strInnovatorServer As String = "MyServer/.../InnovatorServer.aspx"

 

 

 

Dim conn As HttpServerConnection

conn = IomFactory.CreateHttpServerConnection(strInnovatorServer,

 

"databaseProd", TextBox1.Text.Trim(), Innovator.ScalcMD5(TextBox2.Text.Trim()))

 

 

 

conn.Login()

Dim Inn As Innovator = IomFactory.CreateInnovator(conn)

Dim

 

MyItem As IOM.Item = Inn.newItem("User", "get")

MyItem.setAttribute(

"select", "first_name,last_name")

MyItem.setProperty(

"login_name", TextBox1.Text.Trim())

 

Dim MyResult As IOM.Item = MyItem.apply()

 

If MyResult.isError() Then

 

    If MyResult.getErrorDetail().Contains("Authentication failed") Then

        Response.Write(

"<script>alert('Wrong Username or Password !');</script>")

     Else

         Response.Write(

"<script>alert('" + MyResult.getErrorDetail() + "');</script>") ---->error message: The Database is not available

 

 

     Return

 

End If

 

     End If

     End If

 

     Return

 

End If

 

 

 

...

Question: Am I missing anything here ? Any sugestion plz ?