Commit 8c6e9b60 authored by Omar Fantazi's avatar Omar Fantazi

Ajouter des traces log pour afficher le code retour des appels des fonctions WebServices

Enlevre la balise superflue <SpeedChanges> du flux XML SpeedChangeDetails
parent 29c57257
......@@ -95,12 +95,14 @@ namespace InterfaceScadaToIN4RM.Caller.Callers
if (response != null)
{
logger.Info("Call WorkOrderCreation : response.Content : {0}", response.Content);
logger.Info("Call WorkOrderCreation : response.StatusCode : {0}", response.StatusCode);
logger.Info("Call WorkOrderCreation : response.IsSuccessful : {0}", response.IsSuccessful);
logger.Info("Call WorkOrderCreation : response.StatusDescription : {0}", response.StatusDescription);
}
else
{
logger.Info("response is NULLLLL !!! ");
logger.Info("WorkOrderCreation :: response is NULL ! ");
}
......@@ -133,6 +135,18 @@ namespace InterfaceScadaToIN4RM.Caller.Callers
IRestResponse<InvocationResults> response = restClient.Execute<InvocationResults>(request);
if (response != null)
{
logger.Info("Call LineStatusCreation : response.Content : {0}", response.Content);
logger.Info("Call LineStatusCreation : response.StatusCode : {0}", response.StatusCode);
logger.Info("Call LineStatusCreation : response.IsSuccessful : {0}", response.IsSuccessful);
logger.Info("Call LineStatusCreation : response.StatusDescription : {0}", response.StatusDescription);
}
else
{
logger.Info("LineStatusCreation :: response is NULL ! ");
}
return response.Data;
}
......@@ -159,6 +173,18 @@ namespace InterfaceScadaToIN4RM.Caller.Callers
IRestResponse<InvocationResults> response = restClient.Execute<InvocationResults>(request);
if (response != null)
{
logger.Info("Call SpeedChangeDetailCreation : response.Content : {0}", response.Content);
logger.Info("Call SpeedChangeDetailCreation : response.StatusCode : {0}", response.StatusCode);
logger.Info("Call SpeedChangeDetailCreation : response.IsSuccessful : {0}", response.IsSuccessful);
logger.Info("Call SpeedChangeDetailCreation : response.StatusDescription : {0}", response.StatusDescription);
}
else
{
logger.Info("SpeedChangeDetailCreation :: response is NULL ! ");
}
return response.Data;
}
......@@ -184,6 +210,19 @@ namespace InterfaceScadaToIN4RM.Caller.Callers
IRestResponse<InvocationResults> response = restClient.Execute<InvocationResults>(request);
if (response != null)
{
logger.Info("Call ScrapConveyorDetailCreation : response.Content : {0}", response.Content);
logger.Info("Call ScrapConveyorDetailCreation : response.StatusCode : {0}", response.StatusCode);
logger.Info("Call ScrapConveyorDetailCreation : response.IsSuccessful : {0}", response.IsSuccessful);
logger.Info("Call ScrapConveyorDetailCreation : response.StatusDescription : {0}", response.StatusDescription);
}
else
{
logger.Info("ScrapConveyorDetailCreation :: response is NULL ! ");
}
return response.Data;
}
......@@ -209,6 +248,18 @@ namespace InterfaceScadaToIN4RM.Caller.Callers
IRestResponse<InvocationResults> response = restClient.Execute<InvocationResults>(request);
if (response != null)
{
logger.Info("Call HandlingUnitsCreation : response.Content : {0}", response.Content);
logger.Info("Call HandlingUnitsCreation : response.StatusCode : {0}", response.StatusCode);
logger.Info("Call HandlingUnitsCreation : response.IsSuccessful : {0}", response.IsSuccessful);
logger.Info("Call HandlingUnitsCreation : response.StatusDescription : {0}", response.StatusDescription);
}
else
{
logger.Info("HandlingUnitsCreation :: response is NULL ! ");
}
return response.Data;
}
......
......@@ -85,19 +85,6 @@ namespace InterfaceScadaToIN4RM.Caller.Models
}
[XmlRoot(ElementName = "SpeedChanges")]
public class SpeedChanges
{
public SpeedChanges()
{
}
[XmlElement(ElementName = "SpeedChange")]
public List<SpeedChange> SpeedChangeElements { get; set; }
}
[XmlRoot(ElementName = "SpeedChangeDetail", Namespace = "http://schemas.datacontract.org/2004/07/InterfaceWCF.DataContracts.Workshop")]
public class SpeedChangeDetail
{
......@@ -120,8 +107,9 @@ namespace InterfaceScadaToIN4RM.Caller.Models
public string Line { get; set; }
[XmlElement(ElementName = "SpeedChanges")]
public SpeedChanges SpeedChanges { get; set; }
[XmlElement(ElementName = "SpeedChange")]
public List<SpeedChange> SpeedChanges { get; set; }
[XmlAttribute(AttributeName = "xmlns")]
......@@ -135,11 +123,10 @@ namespace InterfaceScadaToIN4RM.Caller.Models
/// </summary>
/// <param name="speedchanges"></param>
/// <returns></returns>
private SpeedChanges getSpeedChangeElements(string speedchanges)
{
SpeedChanges speedChanges = new SpeedChanges();
private List<SpeedChange> getSpeedChangeElements(string speedchanges)
{
SpeedChange speedChange;
speedChanges.SpeedChangeElements = new List<SpeedChange>();
List<SpeedChange> speedChangeElements = new List<SpeedChange>();
string status;
string wonum;
......@@ -178,7 +165,7 @@ namespace InterfaceScadaToIN4RM.Caller.Models
speedChange = new SpeedChange(status, wonum, changedate, startspeed, endspeed, targetspeed, uom,secondbetweenchanges);
speedChanges.SpeedChangeElements.Add(speedChange);
speedChangeElements.Add(speedChange);
}
else
{
......@@ -187,7 +174,7 @@ namespace InterfaceScadaToIN4RM.Caller.Models
}
return speedChanges;
return speedChangeElements;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment