[omniORB] problem about string_to_object

Huang LingHsin linghsin_huang at hotmail.com
Wed Jun 11 18:40:05 BST 2003


Hi all,

       I have a problem about the usage of string_to_object, there are some 
Server code as following , my problem is :

       how to write string_to_object in client ?  
string_to_object("corbaname::Server:2809/NameService#service/service") ? or 
 ("corbaname::Server:2809/NameService#service./service.") or  
("corbaname::Server:2809/NameService#service") ? 


        localObj = orb->resolve_initial_references ( "NameService" );
        rootNamingContext = CosNaming::NamingContext::_narrow ( localObj );

        CosNaming::Name objectName ( 2 );
        objectName.length ( 1 );
        objectName[0].id   = CORBA::string_dup ( "service" );
        objectName[0].kind = CORBA::string_dup ( "" );
        try {
                rootNamingContext->bind_new_context ( objectName );
                }
        catch ( CosNaming::NamingContext::AlreadyBound & )
                {
                }

        // create an object binding to the CORBA Naming Service
        objectName.length ( 1 );
        objectName[0].id   = CORBA::string_dup ( "service" );
        objectName[0].kind = CORBA::string_dup ( "" );
        rootNamingContext->rebind ( objectName, servantObject );
 

Best wishes, 

Fanny

_________________________________________________________________
¤U¸ü³Ì·sª©¥»ªº MSN Messenger¡G»PªB¤Í¦b½u¤W²á¤Ñ¡AÀH®É´x´¤ªÑ¥«°]¸g¡B¤u§@¾÷·|µ¥
³Ì·s¸ê°T http://messenger.msn.com.tw/ 




More information about the omniORB-list mailing list