Calling a web service from asterisk

I need to use phpagi to call a web service from within a dialplan. I can run the web service directly from Linux using pear and client.php but I can’t find how to call it using phpagi. Is there a way to do it or else how can this be done?