<DIV>I am posting this issue in connection with presence of firewalls in the<BR>network. We have a firewall sitting in between client and server, filtering<BR>packets based on TCP ports. A client invokes method on the proxy, which<BR>leads to the server invoking a CALL BACK method on the client object.<BR><BR>I was going through omniORB 4.0.3 documentation and found how to achieve<BR>Bi-directional GIOP, which allows callbacks to be made using a connection<BR>opened by the original client. Based example on src\examples\bidir. </DIV>
<DIV> </DIV>
<DIV>============server code==================================================</DIV>
<DIV> const char* options[][2] = { <BR> { "traceLevel", "40" }, <BR> { "traceExceptions", "1" }, <BR> { "acceptBiDirectionalGIOP", "1" },<BR> { "serverTransportRule", "* unix,tcp,bidir" }, <BR> { "endPoint", "giop:tcp::7788" },<BR> { 0, 0 } <BR> }; </DIV>
<DIV> // Initialise the ORB.<BR> orb = CORBA::ORB_init(argc, argv,"omniORB4",options);</DIV>
<DIV> {<BR> CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");<BR> //CORBA::Object_var obj = orb->resolve_initial_references("omniINSPOA"); <BR> PortableServer::POA_var rootpoa = PortableServer::POA::_narrow(obj);<BR> PortableServer::POAManager_var pman = rootpoa->the_POAManager();<BR> pman->activate();</DIV>
<DIV> // Create a POA with the Bidirectional policy<BR> CORBA::PolicyList pl;<BR> pl.length(1);<BR> CORBA::Any a;<BR> a <<= BiDirPolicy::BOTH;<BR> pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, a);</DIV>
<DIV> PortableServer::POA_var poa = rootpoa->create_POA("bidir", pman, pl);</DIV>
<DIV> server_i* myserver = new server_i();<BR> PortableServer::ObjectId_var myserver_id = PortableServer::string_to_ObjectId("bidirService"); <BR> rootpoa->activate_object_with_id(myserver_id, myserver); <BR> //poa->activate_object_with_id(myserver_id, myserver); <BR> PortableServer::ObjectId_var oid = poa->activate_object(myserver); <BR> obj = myserver->_this();<BR> myserver->_remove_ref();</DIV>
<DIV><BR> CORBA::String_var sior(orb->object_to_string(obj));<BR> cerr <<std::endl<< "Servant ObjectId£º'" << (char*) sior << "'" << endl;<BR> orb->run();<BR> }</DIV>
<DIV> cerr << "bd_server: Returned from orb->run()." << endl;<BR> orb->destroy();</DIV>
<DIV> </DIV>
<DIV>============client code==================================================</DIV>
<DIV> const char* options[][2] = { <BR> { "traceLevel", "40" }, <BR> { "traceExceptions", "1" }, <BR> { "offerBiDirectionalGIOP", "1" },<BR> { "clientTransportRule", "* unix,tcp,bidir" }, <BR> { 0, 0 } <BR> }; </DIV>
<DIV> // Initialise the ORB.<BR> CORBA::ORB_var orb = CORBA::ORB_init(argc, argv,"omniORB4",options);</DIV>
<DIV> {<BR> CORBA::Object_var obj;</DIV>
<DIV> // Initialise the POA.<BR> //obj = orb->resolve_initial_references("RootPOA");<BR> obj = orb->resolve_initial_references("omniINSPOA"); <BR> PortableServer::POA_var rootpoa = PortableServer::POA::_narrow(obj);<BR> PortableServer::POAManager_var pman = rootpoa->the_POAManager();<BR> pman->activate();</DIV>
<DIV> // Create a POA with the Bidirectional policy<BR> CORBA::PolicyList pl;<BR> pl.length(1);<BR> CORBA::Any a;<BR> a <<= BiDirPolicy::BOTH;<BR> pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, a);</DIV>
<DIV> PortableServer::POA_var poa = rootpoa->create_POA("bidir", pman, pl);</DIV>
<DIV> // Get the reference the server.<BR> std::string srv_obj_id("corbaloc::10.1.1.2:7788/bidirService"); <BR> obj = orb->string_to_object(srv_obj_id.c_str());<BR> cb::Server_var server = cb::Server::_narrow(obj);</DIV>
<DIV> // Register a CallBack object in this process.<BR> cb_i* mycallback = new cb_i();<BR> PortableServer::ObjectId_var oid = poa->activate_object(mycallback);<BR> cb::CallBack_var callback = mycallback->_this();<BR> mycallback->_remove_ref();</DIV>
<DIV> /*if( argc == 2 ) <BR> do_single(server, callback);<BR> else <BR> do_register(server, callback, atoi(argv[2]),atoi(argv[3]));*/<BR> do_register(server, callback, 3,1000);</DIV>
<DIV> }<BR> //system("Pause");<BR> // Clean-up. This also destroys the call-back object.<BR> orb->destroy();</DIV>
<DIV> </DIV>
<DIV>-------------------------------------------------------------</DIV>
<DIV>It still is not working and server is unable to invoke callback method on<BR>the client object. Is there anything I am missing here? Also, can I get an<BR>IIOP to HTTP <A class=kLink oncontextmenu="return false;" id=KonaLink3 onmouseover=adlinkMouseOver(event,this,3); style="POSITION: static; TEXT-DECORATION: underline! important" onclick=adlinkMouseClick(event,this,3); onmouseout=adlinkMouseOut(event,this,3); href="http://osdir.com/ml/corba.omniorb.devel/2004-02/msg00001.html#" target=_top><FONT style="FONT-WEIGHT: 400; FONT-SIZE: 10pt; COLOR: blue! important; FONT-FAMILY: Courier New; POSITION: static" color=blue><SPAN class=kLink style="FONT-WEIGHT: 400; FONT-SIZE: 10pt; COLOR: blue! important; FONT-FAMILY: Courier New; POSITION: relative">gateway</SPAN></FONT></A> compatible with omniORB?<BR></DIV>
<DIV>-----Result-----------</DIV>
<DIV>omniORB: throw giopStream::CommFailure from giopStream.cc:1110(0,NO,COMM_FAILURE_MarshalArguments)</DIV>
<DIV>----------------</DIV>
<DIV><BR>Thanks a lot, your help is much appreciated.</DIV>
<DIV> </DIV>
<DIV>roger</DIV>
<DIV><BR> </DIV>
<DIV> </DIV>