Results 1 to 5 of 5

Thread: Icepack and PHP

  1. #1
    sac_urs is offline Registered User
    Join Date
    Nov 2005
    Posts
    10

    Icepack and PHP

    Hi,

    We have a simple server written in python and deployed with icepack. It's working fine with a python client.

    We tried to rewrite the client in PHP and we followed the pointers given in this thread
    http://www.zeroc.com/vbulletin/showthread.php?t=871

    But, we are getting an error like this:

    Code:
    Fatal error: Ice_ObjectPrx::ice_checkedCast() [function.ice-checkedCast]: 
    no Slice definition found for type ::IcePack::Query in testclient.php on line 5
    Here's our PHP code:
    Code:
    <?php
    Ice_loadProfile("pyce");
    global $ICE;
    $query = $ICE->stringToProxy("IcePack/Query")->ice_checkedCast("::IcePack::Query");
    $obj = $query->findObjectByType("::Demo::Hello");
    if($obj != null)
    {
        $calc = $obj->ice_checkedCast("Hello");
    }
    ?>
    What could be the problem ?

    Rgds,
    Sac Urs
    sac_urs@yahoo.co.in
    Programmer - Informedia.
    No URL ATM

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi,

    Are you loading the IcePack Slice files into your "pyce" profile? If so, can you show your IcePHP configuration?

    Take care,
    - Mark

  3. #3
    sac_urs is offline Registered User
    Join Date
    Nov 2005
    Posts
    10
    Relevant part from the php.ini
    Code:
    [Ice]
    ice.profiles = "/home/sac/ice/pyce/ice.profile"
    ice.profile
    Code:
    [pyce]
    ice.slice = "/home/sac/ice/pyce/Hello.ice"
    ice.config = "/home/sac/ice/pyce/config"
    Hello.ice
    Code:
    module Demo {
           interface Hello {
                     void printHello();
            };
    };
    config
    Code:
    #
    # The IcePack locator proxy.
    #
    Ice.Default.Locator=IcePack/Locator:default -p 12000
    
    #
    # IcePack registry configuration.
    #
    IcePack.Registry.Client.Endpoints=default -p 12000
    IcePack.Registry.Server.Endpoints=default
    IcePack.Registry.Internal.Endpoints=default
    IcePack.Registry.Admin.Endpoints=default
    IcePack.Registry.Data=db/registry
    IcePack.Registry.DynamicRegistration=1
    
    #
    # IcePack node configuration.
    #
    IcePack.Node.Name=node1
    IcePack.Node.Endpoints=default
    IcePack.Node.Data=db/node
    IcePack.Node.CollocateRegistry=1
    # Ice.Trace.Network=2
    # IcePack.Node.Trace.Activator=3
    Sac Urs
    sac_urs@yahoo.co.in
    Programmer - Informedia.
    No URL ATM

  4. #4
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    You need to change your ice.slice directive so that it also loads the Slice file that defines the IcePack::Query interface. For example:
    Code:
    ice.slice = "-I/home/sac/Ice-2.1.2/slice /home/sac/ice/pyce/Hello.ice /home/sac/Ice-2.1.2/slice/IcePack/Query.ice"
    - Mark

  5. #5
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    By the way, please update your signature to contain the information we requested in our support policy.

    Thanks,
    - Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 12-03-2010, 05:42 AM
  2. Replies: 1
    Last Post: 04-19-2005, 03:47 AM
  3. Puzzled by IcePack/Locator and IcePack/Query
    By rc_hz in forum Help Center
    Replies: 2
    Last Post: 11-13-2004, 09:41 PM
  4. Replies: 0
    Last Post: 10-21-2004, 05:12 PM
  5. how to call IcePack in php
    By fengxb in forum Help Center
    Replies: 6
    Last Post: 10-18-2004, 09:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •