Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 624
  • Last Modified:

AIML/Program E - Help configuring XMLRPC

Hi, I am working on an AIML chatterbot using "Program E" (http://sourceforge.net/project/showfiles.php?group_id=43190_), I got it all set up and am able to talk to it via the talk.php page but run into a problem trying to communicate with it via XMLRPC.  I did the same thing successfully with a bot made at www.pandorabots.com, using "http://www.pandorabots.com/pandora/talk-xml?" but wanted to host it on my own new site since pandorabots.com can get very slow and even unresponsive at times.

So... I know very little about coding, PHP and XMLRPC, ect, but am competent enough to have gotten this far. ;)

Program E has :
xmlrpcserver.php
then a subdir named "xmlrpc" which contains
phpclient.php

I'm not sure what exactly "http://www.pandorabots.com/pandora/talk-xml" is (IE what type of file it is exactly), but I do know I was able to make it work with that path on the pandorabots site.

So to get it to work with my domain I restructured my http request to either of these php files like this :
http://www.mydomain.com/programe/xmlrpc/phpclient.php?input=text&myid=99999&botname=TestBot
or
http://www.mydomain.com/programe/xmlrpcserver.php?input=text&myid=99999&botname=TestBot

with no luck.  I thought "maybe I need to run the server part first" and just opened "http://www.mydomain.com/programe/xmlrpcserver.php" in a webbrowser, and got this error:

Parse error: parse error, unexpected T_BOOLEAN_AND in /home/content/(my domain info)html/programe/xmlrpcserver.php on line 70

And opening "http://www.mydomain.com/programe/xmlrpc/phpclient.php" in a web browser returns a blank page showing "Say something to Program E" with a text field, but then I type my text into the text field and submit and I get this error message :

Fatal error: Call to a member function on a non-object in /home/content/(my domain info)/html/programe/xmlrpc/phpclient.php on line 47

finally there is a "sampleperlclient.pl" in the xmlrpc subdir, but trying anything with that just gives me an internal server error message.

I am using Godaddy.com hosting.  Once again, I know very little about php and all forms of web coding, and may have phrased things wrong or misunderstanding many things here(entirely self-taught), but was able to get my project working when sending an html request to "http://www.pandorabots.com/pandora/talk-xml?", was able to get program E installed and working on my website... but just can't figure out how to plug my project into Program E via its XMLRPC interface.

Edit : Ug, after doing a little more research, I am using Linux hosting, do I need Windows hosting for XML-RPC to work?  Alternately I could try going through "www.mydomain.com/programe/talk.php" but when I tried structuring it like "www.mydomain.com/programe/talk.php?input=text&myid=99999&botname=TestBot" it didn't seem to post the data and just loads the talk.php chat interface... When I was first developing this using pandorabots.com as the backend I couldn't find the right way to form the request to send data to "http://www.pandorabots.com/pandora/talk?" but was able to make it work once I found out about "http://www.pandorabots.com/pandora/talk-xml?"



0
Confusedly
Asked:
Confusedly
  • 2
  • 2
1 Solution
 
Marcus BointonCommented:
Sounds like you have some simple syntax errors to fix in xmlrpcserver.php, though I don't know why you need that at all since you're writing a client, not a server? The second error is probably a result of the first, so fixing that will fix the second.

Thankfully you don't need to use Windows hosting for XML-RPC. There are numerous XML-RPC classes for PHP on all platforms, including PEAR, plus there is also the PHP XML-RPC extension in PECL, which you can install in most buldable PHP enviroments using 'pecl instll xmlrpc'.

http://www.php.net/manual/en/book.xmlrpc.php
0
 
ConfusedlyAuthor Commented:
You can actually view the source of xmlrpcserver.php here, it is part of program E :
http://dev.dansoftaustralia.net/plugins/scmsvn/viewcvs.php/branches/beta1/bot/src/xmlrpcserver.php?root=smfbot&view=markup&rev=24&pathrev=24

I am writing an external client basically, but already have that all worked out(and working fine with pandorabots.com), just using XML-RPC to communicate with program E on my own webserver instead of pandorabots.  But since I don't know about PHP and am still getting my feet wet with all this, I had assumed that I had set something up wrong (and not that the actual php scripts for Program E I've downloaded have errors)

I did find that there were two groups of "&&" on line 70 of xmlrpcserver.php, and I deleted those, which seems to have resolved the T_BOOLEAN error and then I get a new and much more elaborate error message:

<br />
<b>Warning</b>:  dl(): Unable to load dynamic library './no-debug-non-zts-20001222/xmlrpc/xmlrpc-epi-php.so' - ./no-debug-non-zts-20001222/xmlrpc/xmlrpc-epi-php.so: cannot open shared object file: No such file or directory in <b>/home/content/(my domain info)/html/programe/src/xmlrpcserver.php</b> on line <b>50</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/content/(my domain info)/html/programe/src/xmlrpcserver.php:50) in <b>/home/content/(my domain)/html/programe/src/xmlrpc/xmlrpcs.inc</b> on line <b>178</b><br />
<?xml version="1.0"?>
<methodResponse>
<fault>
  <value>
    <struct>
      <member>
        <name>faultCode</name>
        <value><int>102</int></value>
      </member>
      <member>
        <name>faultString</name>
        <value><string>XML error: syntax error at line 1</string></value>
      </member>
    </struct>
  </value>
</fault>
</methodResponse>

0
 
ConfusedlyAuthor Commented:
Well, I couldn't get around that last error message, but after doing a little research and learning a little PHP I gave up on the XMLRCP "phpclient.php"" was able to modify program E's "talk.php" file to work with the interface I was making.  Thankyou for replying, Squinky!
0
 
Marcus BointonCommented:
That first error is the important one, the rest are just consequences. It looks like something is trying to load the xmlrpc php extension but failing. I don't know what is significant about the 'epi' part.. Make sure that xmlrpc is listed when you do a 'php -m' on a command line (and don't forget to restart apache/IIS too), and that it is listed when you do a phpinfo() call via your web server.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now