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
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()