Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

[SOLVED] Eaccelerator and XMLRPC problem
 
radoslawg
Jr. Member
 
Total Posts:  14
Joined:  2008-12-30
 

[I have identified this as EAccelerator problem. Please see 3rd post]

Hi,
I’m using Python 2.6 and I cannot login to the store using xmlrpc. I’ve tried a lot of combination but I cannot get it to work. Here is the code I tried:

from xmlrpclib import *

proxy ServerProxy('http://www.myshopdomain.pl/api/xmlrpc/')
#proxy.login(['radekg', 'xxxxxxxx'])
#proxy.call('login', {'username':'radekg','apiKey':'xxxxxxxx'})
#proxy.call('login', ['radekg', 'xxxxxxxx'])
#proxy.login('radekg', 'xxxxxxxx')

print proxy.system.listMethods()
#sessionId = proxy.startSession()
#print proxy.system.methodSignature('startSession')
#proxy.endSession([sessionId])

Interesting enough - I can get method list from the server and run parameterless method “startSession” witch returns sensible session key. All other methods fail with:

xmlrpclib.Fault: <Fault 623'Calling parameters do not match signature'>

If anybody can help I would be greatfull!

Thanks,
Radek

 
Magento Community Magento Community
Magento Community
Magento Community
 
radoslawg
Jr. Member
 
Total Posts:  14
Joined:  2008-12-30
 

Further info. I have put up quick java example and I have same problem:

import java.net.MalformedURLException;
import java.net.URL;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

/**
 * @author radekg
 * 
 */
public class SimpleRPC {

    
/**
     * @param args
     */
    
public static void main(String[] args{
        
try {
            
            XmlRpcClientConfigImpl config 
= new XmlRpcClientConfigImpl();

            
config.setServerURL(new URL(
                            
"http://www.mydomain.pl/api/xmlrpc/") );

            
XmlRpcClient client = new XmlRpcClient();
            
client.setConfig(config);

            
Object[] params = new Object[] { new String("radekg"),
                    new 
String("xxxxxxxxxx"};

            
Object result;

            
result client.execute("login"params);
            if (
result != null)
                
System.out.println("Successfully pinged guest account."
                        
result.toString());
            
            
        
catch (XmlRpcException e{
            e
.printStackTrace();
        
catch (MalformedURLException e{
            e
.printStackTrace();
        
}

    }

}

It ends up with:

org.apache.xmlrpc.XmlRpcExceptionCalling parameters do not match signature

BTW. I’m using Magento 1.2.1

Any help?? Maybe some files in magento I could check? I’ve started with 1.8 and then patched it since then - maybe some patches did not applied correctly? Where to look for files that handle rpc api?

Thanks,
Radek.

 
Magento Community Magento Community
Magento Community
Magento Community
 
radoslawg
Jr. Member
 
Total Posts:  14
Joined:  2008-12-30
 

Hi,
After whole day I have finally identified this to be Eaccelerator problem. If I disable it then I can successfully access xmlrpc api.

If I enable it then I can only invoke first function I do after I start apache up. I assume this method goes into the cache (or at least signature) and then it is reused.

How to configure eaccelerator (which boosts site significantly) to ignore xmlrpc? I have failed to do that.

Anyone?

Thanks,
Radek.

 
Magento Community Magento Community
Magento Community
Magento Community
 
radoslawg
Jr. Member
 
Total Posts:  14
Joined:  2008-12-30
 

After sleepless night I have managed to solve this.

If anybody is curious - I had to patch eaccelerator because, out of the box, the filtering is broken and with debug help I manged to filter out “Api/*.php” calls.  This seems to solve the problem.

Radek.

 
Magento Community Magento Community
Magento Community
Magento Community
 
miliscent
Member
 
Avatar
Total Posts:  45
Joined:  2009-03-11
Pittsburgh, Pennsylvania USA
 

Hi Radek,

We have seen this issue as well with eAccelerator.  Can you please post the details of your patch?

Thanks!
Eric

 
Magento Community Magento Community
Magento Community
Magento Community
 
fren
Jr. Member
 
Total Posts:  4
Joined:  2009-12-17
 

If you are running eAccelerator as an Apache Module (not CGI) in .htaccess place this:

php_flag eaccelerator.filter "!api/*.php"

This line filters api calls preventing eAccelerator to cache them.

If eAccelerator is running as CGI you should change the value in php.ini:

eaccelerator.filter "!api/*.php"

Hope this helps.
More info here https://github.com/eaccelerator/eaccelerator/wiki/Settings#eacceleratorfilter

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top