Ejemplo n.º 1
0
 def download(self, options):
     """ download the schema """
     url = self.location
     try:
         if '://' not in url:
             url = urljoin(self.schema.baseurl, url)
         reader = DocumentReader(options)
         d = yield reader.open(url)
         root = d.root()
         root.set('url', url)
         self.__applytns(root)
         raise gen.Return(self.schema.instance(root, url, options))
     except TransportError:
         msg = 'include schema at (%s), failed' % url
         log.error('%s, %s', self.id, msg, exc_info=True)
         raise Exception(msg)
Ejemplo n.º 2
0
 def load(self, url):
     """
     @param url: A URL to the WSDL.
     @type url: str
     """
     self.url = url
     log.debug('reading wsdl at: %s ...', url)
     reader = DocumentReader(self.options)
     d = yield reader.open(url)
     self.root = d.root()
     self.tns = self.mktns(self.root)
     self.add_children(self.root)
     self.children.sort()
     yield self.open_imports()
     self.resolve()
     yield self.build_schema()
     self.set_wrapped()
     for s in self.services:
         self.add_methods(s)
     log.debug("wsdl at '%s' loaded:\n%s", url, self)