Class TratarRetornoAPI
Classe para tratar o retornos das comunicações por API
Inheritance
System.Object
TratarRetornoAPI
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Unimake.Business.DFe
Assembly: Unimake.Business.DFe.dll
Syntax
public static class TratarRetornoAPI
Methods
BuscarXML(ref APIConfig, String)
Método para desserializar e buscar o XML dentro de um JSON
Declaration
static string BuscarXML(ref APIConfig config, string content)
Parameters
Type | Name | Description |
---|---|---|
APIConfig | config | Objeto com as configurações para consumir a API |
System.String | content | Conteúdo |
Returns
Type | Description |
---|---|
System.String |
CreateXmlDocument(String)
Declaration
static XmlDocument CreateXmlDocument(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text |
Returns
Type | Description |
---|---|
System.Xml.XmlDocument |
HtmlToPlainText(String)
Método para "limpar" o HTML, deixando apenas a string com conteúdo
Declaration
static string HtmlToPlainText(string html)
Parameters
Type | Name | Description |
---|---|---|
System.String | html |
Returns
Type | Description |
---|---|
System.String |
ReceberRetorno(ref APIConfig, HttpResponseMessage, ref Stream)
Classifica, faz o tratamento e retorna um XML (caso a comunicação tenha retorno)
Declaration
public static XmlDocument ReceberRetorno(ref APIConfig Config, HttpResponseMessage Response, ref Stream stream)
Parameters
Type | Name | Description |
---|---|---|
APIConfig | Config | |
System.Net.Http.HttpResponseMessage | Response | |
System.IO.Stream | stream |
Returns
Type | Description |
---|---|
System.Xml.XmlDocument |
StringToXml(String)
Método para serializar a string, para que seja realizado a leitura em XML
Declaration
static string StringToXml(string str)
Parameters
Type | Name | Description |
---|---|---|
System.String | str |
Returns
Type | Description |
---|---|
System.String |