Home Help Center

IcePack Question

xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
Helow

I have icepack runing on a linux server whith and ice service

it is posible access to this service from windows clients?

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Yes, you can use IcePack from Windows clients, but you currently cannot run IcePack servers on Windows platforms.

    Take care,
    - Mark
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    My linux clients use this code to adquire a proxy to TiendaService
    Ice::PropertiesPtr properties = communicator()->getProperties();
    	IcePack::QueryPrx query=IcePack::QueryPrx::checkedCast(communicator()->stringToProxy("IcePack/Query"));
    	ClienteAdmin::tienda= TiendaRezAdminPrx::checkedCast(query->findObjectByType("::TiendaRez"));
    

    but this don't compile in windows because the header file IcePack/Query.h is missing


    Then I try in windows creating a proxy from comunicator
       Ice::PropertiesPtr properties = communicator()->getProperties();
       const char* proxyProperty = "Tienda.Proxy";
       std::string proxy = properties->getProperty(proxyProperty);
       Ice::ObjectPrx object= communicator()->stringToProxy(proxy);
       tienda=TiendaRezAdminPrx::uncheckedCast(object);
    

    but the client throw a exception Ice::ObjectNotExist

    I set Tienda.Proxy in config file
    Tienda.Proxy=tienda/tienda:tcp -h Mydomain.com -p 12000
    

    And I create The Object tienda/tienda in server with the next code:
    Ice::Identity idTienda=Ice::stringToIdentity("tienda");
    idTienda.category="tienda";
    if (!TiendaRezI::_evictor->hasObject(idTienda))
    {
                    TiendaRezIPtr tienda=new TiendaRezI();
    	TiendaRezI::_evictor->createObject(idTienda,tienda);
    }
    

    can you said me what is wrong

    Thanks for all
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Originally posted by xdm
    but this don't compile in windows because the header file IcePack/Query.h is missing
    Yes, this will be corrected in the next release. Meanwhile, you can download the project file I provided in this thread if you want to build the IcePack client library on Windows.
    I set Tienda.Proxy in config file
    Tienda.Proxy=tienda/tienda:tcp -h Mydomain.com -p 12000
    
    Is that the endpoint of your server, or is that an IcePack endpoint?

    - Mark
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    the end point is of IcePack
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Originally posted by xdm
    the end point is of IcePack
    If you want to use indirect binding with IcePack, then your proxy needs to have one of the indirect forms (such as tienda/tienda for a well-known object, or tienda/[email protected], etc.).

    The example proxy you used above is a direct proxy that points to the IcePack endpoint, but there is no object with identity tienda/tienda at that endpoint, and therefore Ice::ObjectNotExistException is raised.

    See the IcePack chapter in the manual for more information on indirect proxies.

    Take care,
    - Mark
Sign In or Register to comment.