[omniORB] Removing special characters in corbaloc references

Rob Ratcliff rrr6399 at futuretek.com
Fri May 1 15:24:47 BST 2015


Hi,

I have a simple OmniORBpy service that I'd like to access by simple
corbaloc string such as: corbaloc:iiop:1.2 at hostname:1234/MyServer";
 
I was able to do this using the special omniINSPOA poa accessed like this:

    persistentPoa = orb.resolve_initial_references("omniINSPOA")

    persistentPoa._get_the_POAManager().activate()

    servant = MyServer(serverId)

    persistentPoa.activate_object_with_id("MyServer", servant)
    server = persistantPoa.servant_to_reference(servant)
 
Things got more complicated once I wanted the service to accept a
callback object using bidirectional GIOP:

    persistentPoa = orb.resolve_initial_references("omniINSPOA")

    persistentPoa._get_the_POAManager().activate()

    poa = persistentPoa
    policies = [poa.create_id_assignment_policy(PortableServer.USER_ID),
        poa.create_servant_retention_policy(PortableServer.RETAIN),
       
poa.create_request_processing_policy(PortableServer.USE_SERVANT_MANAGER),
        poa.create_lifespan_policy(PortableServer.PERSISTENT),
        BiDirPolicy.BidirectionalPolicy(BiDirPolicy.BOTH)]
    poa =
persistentPoa.create_POA("bidir",persistentPoa._get_the_POAManager(),policies)

    servant = MyServer(serverId)

    poa.activate_object_with_id("MyServer",servant)
    server = poa.servant_to_reference(servant)
    ior = orb.object_to_string(server)
    print ior

    os.system("catior " + ior)

I get this complicated string:

"\xffomniINSPOA\xffbidir\x00MyServer"

I access this from JacORB using:
    ior = "corbaloc:iiop:1.2@" + hostname + ":" + this.port +
"/%FFomniINSPOA%FFbidir%00MyServer";

Is there a way to get rid of the %FF and %00 characters to simplify the
URL? (I'm OK with the POA  name showing up in the URL.)

I imagine I could work around this by adding a "createSession()" method
in the original service that used the bidirectional GIOP enabled POA,
but wanted to see if there was a way to do it with my original interface.

BTW, can bidirectional GIOP be enabled for the RootPOA or the omniINSPOA?

Thanks,

Rob




More information about the omniORB-list mailing list