Android Question Aras Innovator application

Discussion in 'Android Questions' started by ruy, Sep 29, 2018.

  1. ruy

    ruy Member Licensed User

    I am trying to write a simple application that requests some information from an Aras Innovator database. The Aras manual mentions the use of a IOM.Android.dll in Xamarin.

    I copy from the manual

    "A RT version of IOM.Android.dll can be found in the \Utilities\Aras Innovator
    <Version> IOM SDK\Android directory on the CD Image. You can copy it to another
    location and reference it by an Android App using Xamarin’s existing framework to generate
    an Android project. IOM APIs belong to Aras.IOM namespace. First, every application must
    create a connection with the Aras Innovator server and login to the server using the
    connection. If the login succeeds then create an instance of class Innovator with the
    connection."

    The code suggested in the manual is:

    Imports Aras.IOM
    Dim server As String = "http://localhost/InnovatorServer"
    Dim db As String = "DatabaseName"
    Dim username As String = "Username"
    Dim password As String = "password"
    Dim connection As HttpServerConnection = IomFactory.CreateHttpServerConnection(server, db, username, password)
    Dim user As Item = connection.LoginAsync
    If user.isError Then
    Throw New Exception(user.getErrorString)
    End If

    I will very much appreciate help with a way to access it from B4A?
     
    Last edited: Sep 29, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    The Xamarin DLL will not help. Do they provide a Java SDK?
     
  3. ruy

    ruy Member Licensed User

    Thank you for your prompt reply.

    No, the only alternative they supply is the use of SOAP, I quote from the manual:
    ------------------------------------------------------------------
    Although not normally suggested, it is possible to circumvent IOM and use SOAP requests to interact with
    Aras Innovator. You may use the Microsoft XMLHTTP Object to send the AML to the Aras Innovator
    Server.
    The following is a VBScript example:
    Dim innovatorServer
    innovatorServer =
    "http://localhost/InnovatorServer/Server/InnovatorServer.aspx"
    Dim database: database = "innovator81"
    Dim loginName: loginName = "admin"
    Dim password: password = "607920b64fe136f9ab2389e371852af2" 'MD5 hash of the
    password
    Dim soapStart: soapStart = _
    "<SOAP-ENV:Envelope xmlns:SOAP-
    ENV='http://schemas.xmlsoap.org/soap/envelope/' " &_
    "encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><SOAP-
    ENV:Body>"
    Dim soapEnd: soapEnd = "</SOAP-ENV:Body></SOAP-ENV:Envelope>"
    Dim soapAction: soapAction = "ApplyItem"
    Dim body: body = "<Item type='User' action='get' select='login_name'/>"
    Dim soap
    soap = soapStart & "<" & SOAPAction & " xmlns:m='http://www.aras-corp.com/'>"
    &_
    body & "</" & soapAction & ">" & soapEnd
    Dim http: Set http = CreateObject("Msxml2.ServerXMLHTTP")
    http.open "POST", innovatorServer, false
    http.setRequestHeader "SOAPaction", soapAction
    http.setRequestHeader "AUTHUSER", loginName
    http.setRequestHeader "AUTHPASSWORD", password
    http.setRequestHeader "DATABASE", database
    http.send(soap)
    Dim response: response = http.responseText
    Dim responseDom: Set responseDom = CreateObject("microsoft.xmldom")
    responseDom.loadXML(response)
    Dim userItems: Set userItems =
    responseDom.selectNodes("//Item[@type='User']")
    Wscript.Echo "Number of users: " & userItems.Length
    soapAction = "logoff"
    body = "logoff"
    soap = soapStart & "<" & SOAPAction & " xmlns:m='http://www.aras-corp.com/'>"
    &_
    body & "</" & soapAction & ">" & soapEnd
    http.open "POST", InnovatorServer, false
    http.setRequestHeader "SOAPaction", soapAction
    http.setRequestHeader "AUTHUSER", loginName
    http.setRequestHeader "AUTHPASSWORD", password
    http.setRequestHeader "DATABASE", database
    http.send(soap)
    "
    But I am lost in the line

    Dim password: password = "607920b64fe136f9ab2389e371852af2" 'MD5 hash of the
    password

    Can you help me with this "MD5 hash of the password"
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. ruy

    ruy Member Licensed User

    Thank you I will try it.
     
  6. ruy

    ruy Member Licensed User

    Sorry but I cannot find the library, the library i have B4Xencryption does not have the MessageDigest. I see that it is Andrew Graham´s library but cant find where to get it.

    Would you please send the link to the library, I can´t find it
     
    Last edited: Oct 2, 2018
  7. DonManfred

    DonManfred Expert Licensed User

  8. ruy

    ruy Member Licensed User

    Thank you very much, appreciate your support
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice