From 2cbd83f1ad2684126fdef4935c1b2cf42880c602 Mon Sep 17 00:00:00 2001 From: Transis ERP Date: Wed, 13 Jul 2022 10:01:09 -0300 Subject: [PATCH] Update NFSeSoapServiceClient.cs --- src/OpenAC.Net.NFSe/Providers/NFSeSoapServiceClient.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/OpenAC.Net.NFSe/Providers/NFSeSoapServiceClient.cs b/src/OpenAC.Net.NFSe/Providers/NFSeSoapServiceClient.cs index 671e25fb..4567d899 100644 --- a/src/OpenAC.Net.NFSe/Providers/NFSeSoapServiceClient.cs +++ b/src/OpenAC.Net.NFSe/Providers/NFSeSoapServiceClient.cs @@ -153,6 +153,9 @@ protected virtual string Execute(string soapAction, string message, string soapH Execute(contetType, "POST", headers); + if (!EnvelopeRetorno.IsValidXml()) + throw new OpenDFeCommunicationException("Erro ao processar o xml do envelope SOAP => " + EnvelopeRetorno); + var xmlDocument = XDocument.Parse(EnvelopeRetorno); var body = xmlDocument.ElementAnyNs("Envelope").ElementAnyNs("Body"); var retorno = TratarRetorno(body, responseTag); @@ -165,4 +168,4 @@ protected virtual string Execute(string soapAction, string message, string soapH #endregion Methods } -} \ No newline at end of file +}