Archived
This forum has been archived. Please start a new discussion on GitHub.
how to call IcePack in php
hi,
I use IcePack to administrate my servers now. It works well. I hope find my proxy by IcePack in PHP. Should I write the PHP code?
The endpoint of IcePack Node is "default -p 12000".
In C++, the codes are followed:
IcePack::QueryPrx query = IcePack::QueryPrx::checkedCast(communicator->stringToProxy("IcePack/Query"));
CalculatorPrx calc = CalculatorPrx::checkedCast(query->findObjectByType("::Calc"));
In PHP, I don't know.
Thanks in advance.
Regards,
I use IcePack to administrate my servers now. It works well. I hope find my proxy by IcePack in PHP. Should I write the PHP code?
The endpoint of IcePack Node is "default -p 12000".
In C++, the codes are followed:
IcePack::QueryPrx query = IcePack::QueryPrx::checkedCast(communicator->stringToProxy("IcePack/Query"));
CalculatorPrx calc = CalculatorPrx::checkedCast(query->findObjectByType("::Calc"));
In PHP, I don't know.
Thanks in advance.
Regards,
0
Comments
-
The code to do this in PHP is pretty similar:
$query = $ICE->stringToProxy("IcePack/Query")->ice_checkedCast("::IcePack::Query"); $obj = $query->findObjectByType("::Calc"); if($obj != null) { $calc = $obj->ice_checkedCast("::Calculator"); }
Hope that helps,
- Mark0 -
Thanks for your reply.
If the IcePack node is reside on another host whose IP is '192.168.0.157', how to specifiy the endpoint?
Regards,0 -
Originally posted by fengxb
If the IcePack node is reside on another host whose IP is '192.168.0.157', how to specifiy the endpoint?
Take care,
- Mark0 -
In the example, $obj can be got. But next statement throws an exception: [unknown] => Reference.cpp:711: Ice::NoEndpointException:
no suitable endpoint available for proxy `CalculatorApp -t @ CalculatorApp.Calculator'
BTW, client is on another machine. Does I miss some configure?0 -
Did you define the Ice.Default.Locator property in the PHP configuration? If not, that is most likely the reason for the exception. See the IcePack chapter in the manual for more information on this property.
Take care,
- Mark0 -
Thanks a lot. I have resolve the problem by adding a definition in PHP configuration.0