def get_schema_documents(models, default_namespace=None): '''Returns the schema documents in a dict whose keys are namespace prefixes and values are Element objects. :param models: A list of rpclib.model classes that will be represented in the schema. ''' if default_namespace is None: default_namespace = models[0].get_namespace() fake_app = FakeApplication() fake_app.tns = default_namespace fake_app.services = [] interface = Interface(fake_app) for m in models: interface.add_class(m) interface.populate_interface(fake_app) document = XmlSchema(interface) document.build_interface_document() return document.get_interface_document()
def set_app(self, value): ProtocolBase.set_app(self, value) self.validation_schema = None if value: from rpclib.interface.xml_schema import XmlSchema wsdl = XmlSchema(value.interface) wsdl.build_validation_schema() self.validation_schema = wsdl.validation_schema
def __init__(self, app=None, import_base_namespaces=False, _with_partnerlink=False): """Constructor. :param app: The parent application. :param import_base_namespaces: Include imports for base namespaces like xsd, xsi, wsdl, etc. :param _with_partnerlink: Include the partnerLink tag in the wsdl. """ XmlSchema.__init__(self, app, import_base_namespaces) self._with_plink = _with_partnerlink self.port_type_dict = {} self.service_elt_dict = {} self.root_elt = None self.service_elt = None self.__wsdl = None self.validation_schema = None
def __init__(self, app=None, import_base_namespaces=False, _with_partnerlink=False): '''Constructor. :param app: The parent application. :param import_base_namespaces: Include imports for base namespaces like xsd, xsi, wsdl, etc. :param _with_partnerlink: Include the partnerLink tag in the wsdl. ''' XmlSchema.__init__(self, app, import_base_namespaces) self._with_plink = _with_partnerlink self.port_type_dict = {} self.service_elt_dict = {} self.root_elt = None self.service_elt = None self.__wsdl = None self.validation_schema = None
def get_schema_documents(models, default_namespace=None): '''Returns the schema documents in a dict whose keys are namespace prefixes and values are Element objects. :param models: A list of rpclib.model classes that will be represented in the schema. ''' if default_namespace is None: default_namespace = models[0].get_namespace() fake_app = FakeApplication() fake_app.tns = default_namespace fake_app.services = [] interface = XmlSchema() interface.set_app(fake_app) for m in models: interface.add(m) interface.build_interface_document() return interface.get_interface_document()
def get_validation_schema(models, default_namespace=None): '''Returns the validation schema object for the given models. :param models: A list of rpclib.model classes that will be represented in the schema. ''' if default_namespace is None: default_namespace = models[0].get_namespace() fake_app = FakeApplication() fake_app.tns = default_namespace fake_app.services = [] interface = XmlSchema() interface.set_app(fake_app) for m in models: interface.add(m) interface.build_validation_schema() return interface.validation_schema