Solved

AIML/Program E - Help configuring XMLRPC

Posted on 2008-10-09
4
592 Views
Last Modified: 2013-12-13
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
Comment
Question by:Confusedly
  • 2
  • 2
4 Comments
 
LVL 25

Accepted Solution

by:
Marcus Bointon earned 250 total points
ID: 22685502
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
 

Author Comment

by:Confusedly
ID: 22688589
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
 

Author Closing Comment

by:Confusedly
ID: 31504924
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
 
LVL 25

Expert Comment

by:Marcus Bointon
ID: 22700932
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to use md5 hashing 3 29
Php pie charts 3 26
Put radio button in my form but already has components from my database 4 46
Checking if varaible is empty 6 32
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

30 Experts available now in Live!

Get 1:1 Help Now