1 #include "simple_testC.h"
2 #include "ace/Get_Opt.h"
5 const ACE_TCHAR
*testIOR
= ACE_TEXT ("corbaloc:iiop:localhost:15989/SIMPLE_TEST_KEY");
8 parse_args (int argc
, ACE_TCHAR
*argv
[])
10 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("a:"));
13 while ((c
= get_opts ()) != -1)
17 testIOR
= get_opts
.opt_arg ();
22 ACE_ERROR_RETURN ((LM_ERROR
,
29 // Indicates successful parsing of the command line
34 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
39 CORBA::ORB_init (argc
, argv
, "MY_TEST_ORB");
41 if (parse_args (argc
, argv
) != 0)
47 "OK, now try to resolve a remote "
48 "IORTable::Locator entry...\n"));
50 CORBA::Object_var clientObj
= orb
->string_to_object (testIOR
);
52 simple::SimpleTest_T_var simpleTestClient
=
53 simple::SimpleTest_T::_narrow (clientObj
.in ());
55 if (CORBA::is_nil (simpleTestClient
.in ()))
58 "Simpe client is nil!\n"));
63 "We narrowed the object, now let's invoke it!\n"));
65 simpleTestClient
->shutdown ();
67 catch(const CORBA::OBJ_ADAPTER
&objAdapter
)
69 objAdapter
._tao_print_exception ("CAUGHT OBJ_ADAPTER!!!");
71 catch(const CORBA::OBJECT_NOT_EXIST
&objNE
)
73 objNE
._tao_print_exception ("CAUGHT OBJECT NOT EXIST!!!");
81 catch (const CORBA::Exception
&ex
)
83 ex
._tao_print_exception ("CAUGHT EXCEPTION: ");