Add second work package for REST API implementation
[anna.git] / source / diameter / codec / EngineImpl.cpp
index 5fff449..268cb06 100644 (file)
@@ -85,9 +85,13 @@ Message* EngineImpl::createMessage(const CommandId *id) throw(anna::RuntimeExcep
 //------------------------------------------------------------------------------
 //-------------------------------------------------- EngineImpl::createMessage()
 //------------------------------------------------------------------------------
-Message *EngineImpl::createMessage(const std::string & xmlPathFile) throw(anna::RuntimeException) {
+Message *EngineImpl::createMessage(const std::string & xmlPathFile_or_string, bool pathfile_or_string) throw(anna::RuntimeException) {
   Message *result = createMessage();
-  result->loadXML(xmlPathFile);
+  if (pathfile_or_string)
+    result->loadXMLFile(xmlPathFile_or_string);
+  else
+    result->loadXMLString(xmlPathFile_or_string);
+
   return result;
 }
 
@@ -122,7 +126,7 @@ throw() {
   result->createAttribute("SingleFailedAVP", a_singleFailedAVP ? "yes" : "no");
   result->createAttribute("IgnoreFlags", a_ignoreFlags ? "yes" : "no");
   result->createAttribute("FixMode", asText(a_fixMode));
-  anna::xml::Node* dictionary = result->createChild("EngineImpl.ActivatedDictionary");
+  result->createChild("EngineImpl.ActivatedDictionary");
 
   if(a_dictionary) a_dictionary->asXML(result);