2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.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
[])
37 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
39 if (parse_args (argc
, argv
) != 0)
42 CORBA::Object_var tmp
= orb
->string_to_object(ior
);
44 Test_var hello
= Test::_narrow(tmp
.in ());
46 if (CORBA::is_nil (hello
.in ()))
48 ACE_ERROR_RETURN ((LM_DEBUG
,
49 "Nil Test::Hello reference <%s>\n",
56 Container mycontainer
;
63 mycontainer
.contents
<<= myinner
;
64 myseq
[0] <<= mycontainer
;
65 myseq
[1] <<= mycontainer
;
66 AnySeq_var params
= hello
->RunTest (myseq
);
68 for (CORBA::ULong count
= 0; count
< params
->length(); ++count
)
70 const Container
* container
= 0;
71 if (!(params
[count
] >>= container
))
73 ACE_ERROR ((LM_ERROR
, "ERROR, failed extract\n"));
77 const Inner
* inner
= 0;
78 if (!(container
->contents
>>= inner
))
80 ACE_ERROR ((LM_ERROR
, "ERROR, failed extract\n"));
83 ACE_DEBUG ((LM_DEBUG
, "%d %d %d %d %d\n", inner
->value1
, inner
->value2
, inner
->value3
, inner
->value4
, inner
->value5
));
92 catch (const CORBA::Exception
& ex
)
94 ex
._tao_print_exception ("Exception caught:");