Project

General

Profile

Actions

Webservices from systems written in python

Gustavo Maggi from Latinux kindly contributed the following code to make python apps (in this case OpenERP) able to consume Chamilo's webservices:

# Root de chamilo

url_root = 'http://172.16.1.99/chamilo'

# Conexión
from SOAPpy import SOAPProxy
server = SOAPProxy(url_root+'/main/webservices/soap.php' )

#Hash
import hashlib
import urllib2 as wget

security_key= '5aaaaaa558f0f090140604c26706e180'  # Se encuentra en el archivo main/inc/conf/configuration.php línea 115
my_ip = wget.urlopen(url_root+'/main/webservices/testip.php').readlines()[0][:-1]
secret_key = hashlib.sha1(my_ip+security_key).hexdigest()

Updated by Yannick Warnier about 8 years ago · 1 revisions