2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT("file://broken.ior");
7 parse_args (int argc
, ACE_TCHAR
*argv
[])
9 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
12 while ((c
= get_opts ()) != -1)
16 ior
= get_opts
.opt_arg ();
21 ACE_ERROR_RETURN ((LM_ERROR
,
28 // Indicates successful parsing of the command line
33 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
35 ServerAdmin_var saobj
;
40 orb
= CORBA::ORB_init (argc
, argv
);
42 if (parse_args (argc
, argv
) != 0)
45 CORBA::Object_var tmp
=
46 orb
->string_to_object(ior
);
48 saobj
= ServerAdmin::_narrow (tmp
.in());
50 if (CORBA::is_nil (saobj
.in ()))
52 ACE_ERROR_RETURN ((LM_DEBUG
,
53 "Nil ServerAdmin reference <%s>\n",
58 ArrayTest_var atobj
= saobj
->target();
60 CharArray_var char_array
= CharArray_alloc();
61 for (int i
= 0; i
< 10; i
++)
62 char_array
.inout ()[i
] = (char)('a' + i
);
63 atobj
->a_charArray (char_array
.in ());
65 ACE_DEBUG ((LM_DEBUG
, "a_charArray worked OK.\n"));
67 catch (const CORBA::Exception
& ex
)
69 ex
._tao_print_exception ("Exception caught:");