Hi gcaplan,

Concerning your question on XML-RPC performance.

We integrated OpenERP with a PHP B2B-website a while ago. Our experience:

1. The XML-RPC performance is basically allright, it used to be the standard 
way of connection between the GTK-client and the server prior to version 4. 
Translation of the XML in a procedure call at the server side is performant 
enough.

2. Be carefull how you script your php calls. Every call goes as a verbose 
package over the line, so beware of loops with many obj.reads (anti-pattern 
example below) and use obj.browse as much as possible.

Hope this helps.

Best regards,
Jan
www.synkronized.be

----------------

$sale_order_ids = $resp->value()->scalarval();
            
            foreach ($sale_order_ids as $value){
                
                $sale_order_id = $value->getval();
                
                #lees het saleorder uit
                $msg = new xmlrpcmsg('execute'); 
                $msg->addParam(new xmlrpcval("Company", "string")); 
                $msg->addParam(new xmlrpcval("3", "int")); 
                $msg->addParam(new xmlrpcval("xwxwww", "string")); 
                $msg->addParam(new xmlrpcval("sale.order", "string")); 
                $msg->addParam(new xmlrpcval("read", "string")); 
                $msg->addParam(php_xmlrpc_encode($sale_order_id));              
         
                
                $resp = $client->send($msg);
        
                if ($resp->faultCode()){                
                    return 'code 1::error in reading sale order 
details'.$resp->faultString();
                }
                
                $ret_val = $resp->value()->scalarval();  
                
                $row = array();
                $row['besteldatum'] = $ret_val['date_order']->getval();
                $row['klantreferentie'] = $ret_val['origin']->getval();
                $row['status'] = $ret_val['state']->getval();
                $row['ordernummer'] = $ret_val['name']->getval();
                
                #lookup the orderline ids, based on the orderid
                $key = array(new xmlrpcval(array(new xmlrpcval('order_id' , 
"string"),
                new xmlrpcval('=',"string"),
                new xmlrpcval($sale_order_ids, "int")),"array"),
                );
    
                $msg = new xmlrpcmsg('execute'); 
                $msg->addParam(new xmlrpcval("Company", "string")); 
                $msg->addParam(new xmlrpcval("3", "int")); 
                $msg->addParam(new xmlrpcval("xwwxxx", "string")); 
                $msg->addParam(new xmlrpcval("sale.order.line", "string")); 
                $msg->addParam(new xmlrpcval("search", "string")); 
                $msg->addParam(new xmlrpcval($key, "array"));
                
                $resp = $client->send($msg); 
        
                if ($resp->faultCode()){                    
                    return 'code 1::error in looking up sale order 
lines'.$resp->faultString();
                }            
            
                $sale_order_line_ids = $resp->value()->scalarval();
            
                # loop the ids
                foreach ($sale_order_line_ids as $value){
                
                    $sale_order_line_id = $value->getval();
                
                    #lees de saleorderlijn uit
                    $msg = new xmlrpcmsg('execute'); 
                    $msg->addParam(new xmlrpcval("Company", "string")); 
                    $msg->addParam(new xmlrpcval("3", "int")); 
                    $msg->addParam(new xmlrpcval("xxwwxx", "string")); 
                    $msg->addParam(new xmlrpcval("sale.order.line", "string")); 
                    $msg->addParam(new xmlrpcval("read", "string")); 
                    $msg->addParam(php_xmlrpc_encode($sale_order_line_id));     
                  
                    
                    $resp = $client->send($msg);
            
                    if ($resp->faultCode()){                
                        return 'code 1::error in reading sale order line 
details'.$resp->faultString();
                    }
                    
                    $ret_val = $resp->value()->scalarval();  
                    
                    $line_row = array();
                    $line_row['naam'] = $ret_val['name']->getval();
                    $line_row['hoeveelheid'] = 
$ret_val['product_uos_qty']->getval();
                    $line_row['eenheidsprijs'] = 
$ret_val['price_unit']->getval();
                    
                    $row['bestellijnen']=$line_row;
                }
                
                $ret_array[] = $row;   
            }
            
            return $ret_array;
        }




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=58009#58009

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to