2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT ("file://test.ior");
8 parse_args (int argc
, ACE_TCHAR
*argv
[])
10 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:b"));
13 while ((c
= get_opts ()) != -1)
17 ior
= get_opts
.opt_arg ();
26 ACE_ERROR_RETURN ((LM_ERROR
,
33 // Indicates successful parsing of the command line
38 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
41 CORBA::Object_var tmp
;
45 orb
= CORBA::ORB_init (argc
, argv
);
47 if (parse_args (argc
, argv
) != 0)
50 tmp
= orb
->string_to_object (ior
);
52 catch (const CORBA::Exception
& ex
)
54 ex
._tao_print_exception ("Exception caught:");
60 ACE_DEBUG ((LM_DEBUG
, "client: Invocation expecting to %s\n",
61 (bad_ior
? ACE_TEXT ("fail") : ACE_TEXT ("work"))));
62 Test::Hello_var hello
=
63 Test::Hello::_narrow(tmp
.in ());
65 if (CORBA::is_nil (hello
.in ()))
67 ACE_ERROR_RETURN ((LM_DEBUG
,
68 "Nil Test::Hello reference <%s>\n",
73 CORBA::String_var the_string
=
78 ACE_DEBUG ((LM_DEBUG
,"client: Error: was expecting an exception.\n"));
82 ACE_DEBUG ((LM_DEBUG
, "client: success!\n"));
86 catch (const CORBA::Exception
& ex
)
90 ex
._tao_print_exception ("client: Exception caught:");
93 ACE_DEBUG ((LM_DEBUG
, "client: success!\n"));