Archived
This forum has been archived. Please start a new discussion on GitHub.
IcePHP & IceStorm
lionel
in Help Center
Could I write a IceStorm Publisher with IcePHP?
0
Comments
-
Can you please add your signature as described in this post?0
-
I want to write a forum post informer, when the forum receive a new post, I'll get the information by a desktop application. So I want to write a php publisher to the IceStormService.
here is part of the php code:$p = $ICE->stringToProxy("DemoIceStorm/TopicManager:default -p 10000"); $manager = $p->ice_checkedCast("::IceStorm::TopicManager"); $topic = $manager->retrieve("newpost"); $newpost = ice_uncheckedCast($topic->getPublisher());
when I run the php code, I get an error:
Fatal error: Ice_ObjectPrx::ice_checkedCast() [<a href='function.ice-checkedCast'>function.ice-checkedCast</a>]: no Slice definition found for type ::IceStorm::TopicManager in
\mywork\test\web\publisher.php on line 35 0 -
Then I try to write these code into the slice file to tell php the Slice defination:
module IceStorm { struct LinkInfo { interface Topic { nonmutating string getName(); nonmutating Object* getPublisher(); void subscribe(QoS theQoS, Object* subscriber); idempotent void unsubscribe(Object* subscriber); idempotent void link(Topic* linkTo, int cost) throws LinkExists; idempotent void unlink(Topic* linkTo) throws NoSuchLink; nonmutating LinkInfoSeq getLinkInfoSeq(); void destroy(); }; Topic* theTopic; string name; int cost; }; sequence<LinkInfo> LinkInfoSeq; dictionary<string, string> QoS; exception LinkExists { string name; }; exception NoSuchLink { string name; }; }; module IceStorm { dictionary<string, Topic*> TopicDict; exception TopicExists { string name; IceStorm }; exception NoSuchTopic { string name; }; interface TopicManager { Topic* create(string name) throws TopicExists; nonmutating Topic* retrieve(string name) throws NoSuchTopic; nonmutating TopicDict retrieveAll(); }; };
After doing that, I could not start the apache again:(
I think maybe the Ice prefix is reserved, so the namespace name IceStorm is conflict with the ICE run time.0
