1 #include "ace/Get_Opt.h"
3 #include "Client_ORBInitializer.h"
5 #include "tao/ORBInitializer_Registry.h"
7 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
10 parse_args (int argc
, ACE_TCHAR
*argv
[])
12 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
15 while ((c
= get_opts ()) != -1)
19 ior
= get_opts
.opt_arg ();
22 ACE_ERROR_RETURN ((LM_ERROR
,
33 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
37 PortableInterceptor::ORBInitializer_ptr temp_initializer
;
39 ACE_NEW_RETURN (temp_initializer
,
40 Client_ORBInitializer
,
41 -1); // No exceptions yet!
42 PortableInterceptor::ORBInitializer_var initializer
=
45 PortableInterceptor::register_orb_initializer (initializer
.in ());
48 CORBA::ORB_init (argc
, argv
);
50 if (parse_args (argc
, argv
) != 0)
53 CORBA::Object_var object
=
54 orb
->string_to_object (ior
);
56 Interop::CDR_Out_Arg_var server
=
57 Interop::CDR_Out_Arg::_narrow (object
.in ());
59 if (CORBA::is_nil (server
.in ()))
61 ACE_ERROR_RETURN ((LM_ERROR
,
62 "Object reference <%s> is nil.\n",
68 CORBA::Long_out
arg (lv
);
70 server
->get_out (arg
);
72 ACE_DEBUG ((LM_DEBUG
, "first call passed\n"));
74 server
->get_out (arg
);
76 ACE_DEBUG ((LM_DEBUG
, "second call passed\n"));
82 catch (const CORBA::Exception
& ex
)
84 ex
._tao_print_exception ("Caught exception in client:");