Estou tentando Migrar um APP para NFe 4.00, esse app foi desenvolvido por outro Programador
eu particularmente nunca trabalhei com NFe,
então estou perdidinho
pela NT_2016_002_V100
já criei o XML
Ja migrei os XSD para o 4.00
mais não estou conseguindo Consumir o WebServise
o Sistema usa o Seguinte código (consultar Status Serviço)
Try
Dim xHeaderMsg As New XmlDocument
Dim strUrl As String
Dim strXML As String
Pnome = LeArquivoINI(nome_arquivo_ini, "Nota", "hambiente", "Configure")
If UrlAcesso.CodigoUF = "" Then
UrlAcesso = BuscaURL(MinhaUF, Pnome)
End If
strUrl = UrlAcesso.UrlNfeStatusServico
If Pnome = "HOMOLOGAÇÃO" Then
Pnome = 2
Else
Pnome = 1
End If
strXML = "<?xml version=" & """1.0""" & " encoding=" & """UTF-8""" & "?>"
strXML = strXML & "<consStatServ xmlns=" & """http://www.portalfiscal.inf.br/nfe""" & " versao=" & """4.10"""
& ">"
strXML = strXML & "<tpAmb>" & Pnome & "</tpAmb>"
strXML = strXML & "<cUF>" & UrlAcesso.CodigoUF & "</cUF>"
strXML = strXML & "<xServ>STATUS</xServ>"
strXML = strXML & "</consStatServ>"
'Adição do Certificado ao Web Service
'====================================
Dim wSer As New NfeStatusServico2(strUrl)
Dim retorno As New Object
wSer = New NfeStatusServico2(strUrl)
wSer.Url = strUrl
Dim certificado As X509Certificate2 = CertificadoDigital.SelecionarCertificado("")
wSer.ClientCertificates.Add(certificado)
wSer.Timeout = 10000
Novo:
xHeaderMsg.LoadXml(strXML)
xHeaderMsg.Save(SPath & "\ConsultaST.xml")
sXSD = System.Windows.Forms.Application.StartupPath & "\" & "PL_009\consStatServ_v4.40.xsd"
Dim resultado As String = ValidaXML.ValidarXML(xHeaderMsg, sXSD)
retorno = wSer.nfeStatusServicoNF2(xHeaderMsg).Item("xMotivo").InnerText
funConsultaStatus = retorno.ToString
If funConsultaStatus = "Rejeição: Cabeçalho - Falha no Schema XML" Then
GoTo Novo
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
quanto executo o Retorno do Webservice e um erro de Handle request
alguem tem alguma dica? acredito que eu esteja tentando consumir o Webserve de forma errada
mais não achei nada que me ajude na WEB
Deus e o Maior