To use the IDK's Programmable Remote Client (PRC) Remote APIs, you must first establish a session with ALI or Ensemble.
Java:
import java.net.URL; import com.plumtree.remote.prc.*; public class HelloWorldSession { public static void main(String[] args) throws Exception { try { IRemoteSession session = RemoteSessionFactory.getExplicitLoginContext( new URL("http://portalserver/ptapi/services/QueryInterfaceAPI"), "administrator",""); System.out.println(session.getAPIVersion()); } catch(Exception e) { System.err.println(e.getMessage()); e.printStackTrace(System.err); } } }
.NET (C#):
using System; using Plumtree.Remote.PRC; public class HelloWorldSession { public static void Main(string[] args) { try { IRemoteSession session = RemoteSessionFactory.GetExplicitLoginContext( new Uri("http://portalserver/ptapi/services/QueryInterfaceAPI"), "administrator",""); Console.Out.WriteLine(session.GetAPIVersion()); } catch(Exception e) { Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); } } }
.NET (VB):
Imports System Imports Plumtree.Remote.PRC Module HelloWorldSession Sub Main() Try Dim session As IRemoteSession session = RemoteSessionFactory.GetExplicitLoginContext( _ New Uri("http://portalserver/ptapi/services/QueryInterfaceAPI"), _ "administrator", _"") Console.Out.WriteLine(session.GetAPIVersion()) Catch e As Exception Console.Error.WriteLine(e.Message) Console.Error.WriteLine(e.StackTrace) End Try End Sub End Module