OVH Community, votre nouvel espace communautaire.

Impossible d'utilser soap avec python // WSDL Invalide ?


kiorky
21/02/2011, 22h55
Lié a un autre topic cf http://forum.ovh.com/showthread.php?t=49412

kiorky
21/02/2011, 11h49
Hum en fait le trunk de soappy mange mieux la wsdl.

Parcontre je préférerai vraiment utiliser suds plus récent mieux codé et surtout maintenu.

Si quelqu'un a une idée

kiorky
21/02/2011, 11h20
Salut, j'essaye d'attaquer le WSDL d'ovh pour chopper les information de facturation mais ca ne marche pas. A priori la WSDL n'est pas valide.

J'utiiise python, et que ce soit avec soappy ou suds, ca plante:

Voici un exemple avec suds

Code:
import logging
from suds.client import Client
from suds.xsd.sxbasic import Import
from suds.xsd.doctor import Import as dImport
from suds.xsd.doctor import ImportDoctor
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
logging.getLogger('suds.wsdl').setLevel(logging.DEBUG) 
logging.getLogger('suds.umx.core').setLevel(logging.DEBUG) 
logging.getLogger('suds.umx.typed').setLevel(logging.DEBUG) 
Import.bind('http://schemas.xmlsoap.org/soap/encoding/')
Import.bind('http://schemas.xmlsoap.org/wsdl/')
Import.bind('http://schemas.xmlsoap.org/wsdl/soap/')
OVH_WSDL = 'http://www.ovh.com/soapi/soapi-dlw-1.16.wsdl'
imp = dImport('http://schemas.xmlsoap.org/soap/encoding/')
imp.filter.add('http://schemas.xmlsoap.org/wsdl/') 
imp.filter.add('http://schemas.xmlsoap.org/wsdl/soap/') 
imp.filter.add(OVH_WSDL) 
doctor = ImportDoctor(imp) 
client = Client(OVH_WSDL, doctor=doctor)
# user, password
session =  client.service.login("*****","****", 'fr', 0)
invoices = client.service.billingInvoiceList(session)

L'erreur est :
Code:
TypeNotFound: Type not found: 'typens:domain'