Commit a771a265 authored by Brayan Sarmiento's avatar Brayan Sarmiento
Browse files

Obtener Xml Formateado

parent b7dc25ca
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
using System.Xml.Linq;
using EvaPosSCOSrv; using EvaPosSCOSrv;
using Serilog; using Serilog;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace gatewaySCO.POSBC; namespace gatewaySCO.POSBC;
...@@ -83,7 +85,7 @@ public class ClienteServidorPOSBC(string ip, int pto) ...@@ -83,7 +85,7 @@ public class ClienteServidorPOSBC(string ip, int pto)
_contadorMensajesEnviados++; _contadorMensajesEnviados++;
Log.Information("Mensaje #{contador} para POSBIC {ip} - {msj}", _contadorMensajesEnviados, _ip, bytesMensaje.ToString); Log.Information("Mensaje #{contador} para POSBIC {ip} - {msj}", _contadorMensajesEnviados, _ip, bytesMensaje.ToString);
Log.Information("Esperando respuesta.."); Log.Information("Esperando respuesta..");
// Leer la respuesta del servidor // Leer la respuesta del servidor
byte[] buffer = new byte[1024]; // Tamaño del buffer inicial byte[] buffer = new byte[1024]; // Tamaño del buffer inicial
int totalBytesRead = 0; int totalBytesRead = 0;
...@@ -106,6 +108,7 @@ public class ClienteServidorPOSBC(string ip, int pto) ...@@ -106,6 +108,7 @@ public class ClienteServidorPOSBC(string ip, int pto)
bufferEntrada = ms.ToArray(); bufferEntrada = ms.ToArray();
} }
_contadorMensajesRecibidos++; _contadorMensajesRecibidos++;
string result = Encoding.UTF8.GetString(bufferEntrada);
Log.Debug("Respuesta #{contador} de POSBC {ip} - {msj}", _contadorMensajesRecibidos, _ip, bufferEntrada.ToString); Log.Debug("Respuesta #{contador} de POSBC {ip} - {msj}", _contadorMensajesRecibidos, _ip, bufferEntrada.ToString);
return bufferEntrada; return bufferEntrada;
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
"POS_comment": "Indicates the set of commands to instantiate, according to the type of POS: evapos, tests, gk, etc.", "POS_comment": "Indicates the set of commands to instantiate, according to the type of POS: evapos, tests, gk, etc.",
"IpGateway": "127.0.0.1", "IpGateway": "127.0.0.1",
"IpGateway_comment": "Gateway IP, local or remote", "IpGateway_comment": "Gateway IP, local or remote",
"PortGateway": 6697, "PortGateway": 6690,
"PortGateway_comment": "Gateway IP Port", "PortGateway_comment": "Gateway IP Port",
"Language": "es", "Language": "es",
"Language_comment": "Language code as needed by the POS application" "Language_comment": "Language code as needed by the POS application"
}, },
"POSBC": { "POSBC": {
"IpPOSBC": "127.0.0.1", "IpPOSBC": "127.0.0.1",
"PortPOSBC": 6698 "PortPOSBC": 6697
}, },
"DataGK": { "DataGK": {
"IpGkSmartPOS": "10.10.117.10", "IpGkSmartPOS": "10.10.117.10",
......
Supports Markdown
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