Home Help Center

Querying the Object Adapter endpoints

How can I query (or get) the endpoints of my object adapter from code?
Because when it comes from an external config file, or uses the 'default' random assigned port number - it is unknown by me.

I want to do a reverse process as a StringToProxy() - I want to create a string which contains all the information to access a registered object on a server - create a string, which can be sent away in the net to other Ice client to use the StringToProxy() function.

I cannto use the IcePack possibility for some reasons for this purpose - this is why I want to find another way to solve this problem.

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    The only way I can think of is to create a proxy with ObjectAdapter :: createProxy() (use a dummy identity), and then convert it to a string representation with Communicator :: proxyToString().
  • aroanaroan Member
    Ice.ObjectPrx prx = adapter.createProxy(Ice.Util.stringToIdentity("xx"));
    string s = ic.proxyToString( prx );

    it generates: s = "xx [email protected]"

    so it doesn't work :(
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Right, this doesn't work if you use indirect proxies. There is no way to access the endpoint information in this case.
  • aroanaroan Member
    Ooops, something wrong. It is on the server side. Not on the client side. The server creates the Object Adapter using a config file to read the endpoint definition from outside. What I wanna know is what are the final endpoints which are set by the ICE run-time for that O.A. How comes the indirect proxy here?
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    You probably have an AdapterId property defined for your adapter. If you are not using indirect proxies, there is no need for this property.

    - Mark
  • aroanaroan Member
    Mes, you are right. I had an AdapterId... When I comment it out, it is worlking now. Thanks a lot! :)
Sign In or Register to comment.