javaremedy

How to authenticate in Remedy using Java


I need to authenticate myself in Remedy. I'm following the documentation, but I still getting some errors. https://communities.bmc.com/docs/DOC-17514

This is my code:

import com.bmc.arsys.api.ARException;
import com.bmc.arsys.api.ARServerUser;

public class Tutorial {
    public static void main(String[] args) {
        ARServerUser ctx = new ARServerUser();
        ctx.setServer("127.0.0.1");
        ctx.setUser("myusername");
        ctx.setPassword("mypassword");
        ctx.setPort(8080);

        try {
            ctx.verifyUser();
        } catch (ARException e) {
            System.out.println(e.getMessage());
        }
    }
}

I'm receiving this error: ERROR (91): RPC call failed; 127.0.0.1:8080 can not receive ONC/RPC data

How can I fix that? I need to set the instance, like 127.0.0.1/arsys. My Remedy instance is arsys.

I can authenticate using the browser: http://127.0.0.1:8080/arsys

Thanks in advance.


Solution

  • is your midtier on the same server as your AR server?

    if not, then You need to set the IP of your AR server instead.