def __get_binding_application(self, binding_service, model): """Builds an instance of soaplib.Application The Application built is populated with an instance of a Service Class based on DefinitionBase @param binding_service: class based on DefinitionBase @param model: An ClassModel """ binding_application = Application([binding_service], model.get_namespace()) # The lxml Element nsmap is being overridden to remove the unneeded # namespaces binding_application.nsmap = XSDGenerator.model_schema_nsmap binding_application.prefmap = \ dict([(b,a) for a,b in XSDGenerator.model_schema_nsmap.items()]) binding_application.call_routes = {} if self.custom_map: for prefix, namespace in self.custom_map.items(): binding_application.set_namespace_prefix(namespace, prefix) return binding_application