Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling Remote method of CORBA object  RSS feed

 
kavita kumari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai to all,
I have client program running on one machine, the server program running on different machine of different domain. My question is how to interact with the servers of other domains. Clear explanation is always welcome
Thanks
Kavita
 
praveen p kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai
In the client program set the ORBInitialHost where your server is running along with the ORBInitialPort
hope the code attached will help u

try
{
String args[]={"-ORBInitialHost","praveen","-ORBInitialPort","1050"};
//showStatus("ORBInitialPort -1050");
ourORB = ORB.init(args,null);
connect();
}

protected void connect()
{
try
{
// Get the root naming context.
org.omg.CORBA.Object obj = ourORB.resolve_initial_references("NameService");
NamingContext namingContext = NamingContextHelper.narrow(obj);
NameComponent nameComponent = new NameComponent("Hello","");
NameComponent path[] = { nameComponent };
hello myhelloServer = helloHelper.narrow(namingContext.resolve(path));
System.out.println(myhelloServer.getConnection());
//showStatus(tf.getText());
}
catch (Exception ex)
{
System.err.println("Couldn't resolve StockServer: " + ex);
return;
}
System.out.println("Succesfully bound to a HelloServer.");
}
 
kavita kumari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for giving reply. But what is unfortunate is,
I tried the same prior to posting this question. But
it is working with in the domain only. The control is
not passing the domain border...
Is there any other mechanism to handle it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!