diff --git a/OPDM/OPDM_SOAP_API.py b/OPDM/OPDM_SOAP_API.py index c7a907a..9148688 100644 --- a/OPDM/OPDM_SOAP_API.py +++ b/OPDM/OPDM_SOAP_API.py @@ -359,7 +359,9 @@ def query_object(self, object_type="IGM", metadata_dict=None, components=None, d query_object = self.Operations.QueryObject.format(query_id=query_id) - query_object = add_xml_elements(query_object, ".//opdm:OPDMObject", {"pmd:Object-Type": object_type}) + # Use default object type or passed in object type from function call, if not defined directly in query metadata + if not metadata_dict.get("pmd:Object-Type"): + metadata_dict["pmd:Object-Type"] = object_type if metadata_dict: query_object = add_xml_elements(query_object, ".//opdm:OPDMObject", metadata_dict)