2 #include "ace/streams.h"
5 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
10 "Initializing the ORB!\n"));
11 CORBA::ORB_var the_orb
= CORBA::ORB_init (argc
, argv
);
13 CORBA::Object_var orb_obj
=
14 the_orb
->resolve_initial_references ("RootPOA");
16 PortableServer::POA_var the_root_poa
=
17 PortableServer::POA::_narrow (orb_obj
.in ());
19 PortableServer::POAManager_var the_poa_manager
=
20 the_root_poa
->the_POAManager ();
22 // Retrieving the servants IOR from a file
24 "Reading the IOR!\n"));
26 const ACE_TCHAR
*filename
= ACE_TEXT("file://ior.txt");
29 the_orb
->string_to_object (filename
);
32 "Narrowing the IOR!\n"));
34 W32_Test_Interface_var mycall
=
35 W32_Test_Interface::_narrow (orb_obj
.in ());
38 "Sending the Request!\n"));
39 char *response
= mycall
->getresponse (1);
41 "The answer ...%s\n", response
));
43 // Free up the string.
44 CORBA::string_free (response
);
46 catch (const CORBA::Exception
& ex
)
48 ex
._tao_print_exception ("Caught exception:");