X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=wsdl%2Fsfa2wsdl.py;h=2eb9463ccd419a828da318a86d950b0a3e122703;hb=796d35d54ab31e209ddf76b4584b6508b309c6c1;hp=3811d705989ef9fdd5effa59b39c61c40c273ad6;hpb=554cab46e9b7dd40fe67bfb3972f3d15eaf1a354;p=sfa.git diff --git a/wsdl/sfa2wsdl.py b/wsdl/sfa2wsdl.py index 3811d705..2eb9463c 100755 --- a/wsdl/sfa2wsdl.py +++ b/wsdl/sfa2wsdl.py @@ -9,7 +9,6 @@ import os, sys import time import pdb import xml.dom.minidom -#import xml.dom.ext import apistub import inspect @@ -18,6 +17,8 @@ from optparse import OptionParser from sfa.storage.parameter import Parameter, Mixed +from sfa.util.py23 import StringType + plc_ns="http://www.planet-lab.org/sfa" class SoapError(Exception): @@ -163,11 +164,11 @@ class WSDLGen: return "xsd:boolean" elif arg_type == FloatType: return "xsd:double" - elif arg_type in StringTypes: + elif issubclass(arg_type, StringType): return "xsd:string" else: pdb.set_trace() - raise SoapError, "Cannot handle %s objects" % arg_type + raise SoapError("Cannot handle %s objects" % arg_type) def param_type(self, arg): return (self.name_complex_type(arg)) @@ -189,7 +190,7 @@ class WSDLGen: in_el.setAttribute("name", method + "_in") for service_name in function.interfaces: - if (self.services.has_key(service_name)): + if (service_name in self.services): if (not method in self.services[service_name]): self.services[service_name].append(method) else: @@ -327,10 +328,9 @@ class WSDLGen: def pretty_print(self): if (self.wsdl): - #xml.dom.ext.PrettyPrint(self.wsdl) - xml.dom.minidom.Document.toprettyxml(self.wsdl) + print xml.dom.minidom.Document.toprettyxml(self.wsdl) else: - raise Exception("Empty WSDL") + raise Exception("Empty WSDL") def main(): parser = OptionParser()