public HttpResponseMessage PostMessage([FromBody] ProvisioningPostMessage message) { try { _logger.WriteLogEntry(_tenantId.ToString(), null, string.Format(MethodBase.GetCurrentMethod().Name + " in ProvisioningAPI was called."), LogLevelType.Info); if (message == null) { throw new Exception("Did not receive an json message in the post body."); } var equipmentConnectionSetting = Setup(message.EquipmentId); if (equipmentConnectionSetting == null) { throw new Exception("Could not find and connection settings for the equipmentId."); } var service = new CalixService(_tenantId, equipmentConnectionSetting, _logger); var response = service.PostMessageRaw(message.SoapMessage); //var doc = new XmlDocument(); //doc.LoadXml(response); //var jsonResponse = JsonConvert.SerializeXmlNode(doc); //var myObject = JsonConvert.DeserializeObject(jsonResponse); _logger.WriteLogEntry(_tenantId.ToString(), new List <object> { response }, string.Format(MethodBase.GetCurrentMethod().Name + " in ProvisioningAPI. Response({0})", HttpStatusCode.OK), LogLevelType.Info); return(this.Request.CreateResponse(HttpStatusCode.OK, response)); } catch (Exception ex) { _logger.WriteLogEntry(_tenantId.ToString(), null, string.Format(MethodBase.GetCurrentMethod().Name + " in ProvisioningAPI. Response."), LogLevelType.Error, ex); throw; } }