[omniORB] Modules in modules - am I doing it right?
Robert Schumann
rob@bodab.se
Tue, 11 May 1999 19:51:03 +0200
I am trying to compile and use an IDL I have got from Orbixweb Java
developers.
I get an exception of CORBA::OBJECT_NOT_EXIST when I call the only procedure
in the object.
What is wrong ? Am I doing it right with the modules ?
The IDL is extremely simple but has modules in modules like this:
---------------------------------------------------------------------------
module country{
module company{
module project{
module hack{
exception DemoException{
string reason;
string ctx; //Context of Error
string responsible;
};//end of exception
interface Test{
string getResponse( in string str )raises(DemoException);
}; //end of interface
}; // end module hack
}; // end module project
}; // end module company
}; // end module country
--------------------------------------------------------------------------
I compile it and implement a client call like this:
CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB2");
CORBA::BOA_ptr boa = orb->BOA_init(argc,argv,"omniORB2_BOA");
try {
CORBA::String_var src =(const char *)"Hello world!";
CORBA::String_var dest;
CORBA::Object_var obj = orb->string_to_object(stringified_IOR);
if (CORBA::is_nil(obj)) {
MBox("Do_Corba","Cannot invoke on a nil object reference.");
return ;
}
// ***** Is this right? ******
country::company::project::hack::Test_ptr TestSrv =
country::company::project::hack::Test::_narrow(obj);
if (CORBA::is_nil(demoSrv)) {
MBox("Do_Corba","Cannot invoke on a nil object reference.");
return ;
}
dest=TestSrv->getResponse(src); //******* This is where I get the
exception *******
}
..............................
Robert Schumann - rob@dtek.se
BODAB Datateknik AB
http://www.dtek.se
..............................