ConverterJsonParaXml(aJson)
Método responsável pela geração do XML de envio da MDFe, a partir do caminho do Json.
Método
ConverterJsonParaXml(const aJsonFile: string): string;
Parâmetros
Argumento | Tipo | Detalhes |
aJsonFile | String | Caminho do arquivo Json (devidamente preenchido) |
Exemplos
JSON
{
"incluirenviMDFe": [
{
"idLote": "1",
"Versao_2": "3.00",
"cUF_5": "41",
"tpAmb_6": "2",
"tpEmit_7": "1",
"mod_8": "58",
"serie_9": "9",
"nMDF_10": "842",
"cMDF_11": "00000842",
"modal_13": "1",
"dhEmi_14": "2022-03-07T14:04:00-03:00",
"tpEmis_15": "1",
"procEmi_16": "0",
"verProc_17": "5.0",
"UFIni_18": "PR",
"UFFim_19": "SC",
"CNPJ_26": "08187168000160",
"IE_27": "9044016688",
"xNome_28": "TecnospeedTi",
"xFant_29": "TecnospeedTi",
"xLgr_31": "RUA VEREADOR ANACLETO DO CARMO",
"nro_32": "720",
"xBairro_34": "VILA RONDON",
"cMun_35": "4115200",
"xMun_36": "MARINGA",
"CEP_37": "86400000",
"UF_38": "PR",
"fone_39": "4335271323",
"email_40": "suporte@suporte.com.br",
"versaoModal_42": "3.00",
"qCTe_69": "1",
"qNFe_71": "0",
"vCarga_73": "54743.52",
"cUnid_74": "01",
"qCarga_75": "32240.0000",
"indCarregaPosterior_101": "1",
"tpCarga_200": "01",
"xProd_201": "TESTE PROD PREDOMINANTE",
"cEAN_202": "7899009080365",
"NCM_203": "82054000",
"CEP_204": "87020050",
"CEP_207": "87020070"
}
],
"incluirinfMunDescarga": [
{
"cMunDescarga_46": "4205407",
"xMunDescarga_47": "FLORIANOPOLIS"
}
],
"incluirinfCTe": [
{
"chCTe_49": "41180411525644000110570010000000751000008153"
}
],
"incluirinfMunCarrega": [
{
"cMunCarrega_21": "4115200",
"xMunCarrega_22": "MARINGA"
}
],
"incluirseg": [
{
"respSeg_153": "1",
"CNPJ_154": "11525644000110",
"xSeg_156": "PORTO SEGURO - CIA DE SEGUROS",
"CNPJ_157": "61198164000160",
"nApol_158": "06540713572"
}
],
"incluirnaver": [
{
"nAver_159": "73652309182"
}
],
"incluirrodo": [
{
"RNTRC_rodo_2": "48695023",
"cInt_rodo_5": "014-1",
"placa_rodo_6": "HQV0325",
"tara_rodo_7": "15100",
"capKG_rodo_8": "48500",
"capM3_rodo_9": "500",
"tpRod_rodo_34": "03",
"tpCar_rodo_35": "02",
"UF_rodo_36": "PR"
}
],
"incluircondutor": [
{
"xNome_rodo_13": "LUCAS LAVORATO",
"CPF_rodo_14": "04462685938"
}
],
"incluirinfContratante": [
{
"CNPJ_rodo_173": "02631144000171",
"NroContrato_219": "12",
"vContratoGlobal_220": "15.00"
}
],
"incluirinfpag": [
{
"CNPJ_187": "08187168000160",
"vContrato_189": "10.00",
"indPag_190": "0",
"vAdiant_216": "1.00",
"indAntecipaAdiant_217": "1",
"tpAntecip_218": "0",
"vContrato_189": "10.00",
"indAltoDesemp_214": "1",
"PIX_215": "46223169000"
}
],
"INCLUIRCOMP": [
{
"tpComp_194": "99",
"vComp_195": "1.00",
"xComp_196": "xComp"
}
]
}
Retorno
O retorno é o XML de envio do MDFe.
Exemplos
Delphi
retorno := spdMDFe.ConverterJsonParaXml('C:\Users\emanoel.oliveira\Desktop\Utils\MDFe\Arquivo.Json');
C#
retorno = spdMDFe.ConverterJsonParaXml("C:\\Users\\emanoel.oliveira\\Desktop\\Utils\\MDFe\\Arquivo.Json");
Visual Basic 6
retorno = spdMDFe.ConverterJsonParaXml("C:\Users\emanoel.oliveira\Desktop\Utils\MDFe\Arquivo.Json")
PHP
$retorno = spdMDFe->ConverterJsonParaXml("C:\Users\emanoel.oliveira\Desktop\Utils\MDFe\Arquivo.Json");
Comentários
0 comentário
Por favor, entre para comentar.