FONTE NFE VB.NET

MITSUEDA 19/02/2015 11:36:02
#444601
Elucimar,

Obrigado pela resposta, mas ainda não é isso.

Porque esse trecho do código não é o que grava no XML.

Acredito que seja algo nesse trecho

Private _dhEmi As DateTime

Public Property dhEmi() As DateTime
Get
Return _dhEmi
End Get
Set(ByVal value As DateTime)
_dhEmi = value
End Set
End Property

Ou alguma outra formatação que devo inserir no trecho Private _dhEmi As DateTime, mas não estou conseguindo fazer.

ELUCIMAR 19/02/2015 12:53:17
#444602
Então grava a hora atual nesta propriedade da Classe e na parte que gera o Xml formata a data: [Ô]yyyy-MM-ddTHH:mm:sszzz[Ô]
FOXMAN 19/02/2015 17:37:24
#444619
Citação:

:
Elucimar,

Obrigado pela resposta, mas ainda não é isso.

Porque esse trecho do código não é o que grava no XML.

Acredito que seja algo nesse trecho

Private _dhEmi As DateTime

Public Property dhEmi() As DateTime
Get
Return _dhEmi
End Get
Set(ByVal value As DateTime)
_dhEmi = value
End Set
End Property

Ou alguma outra formatação que devo inserir no trecho Private _dhEmi As DateTime, mas não estou conseguindo fazer.



Amigo, eu tive que mudar essa propriedade de DateTime para String.

Citação:

.infNFE.Ide.dhEmi = cnfGeral.RemoveAcento(CDate(dtemi).ToString([Ô]yyyy-MM-ddTHH:mm:sszzz[Ô]))

NILSONTRES 19/02/2015 18:40:24
#444623
.WriteElementString([Ô]dhEmi[Ô], Format(Me.dhEmi, [Ô]yyyy-MM-dd[Ô]) & [Ô]T[Ô] & Format(Now.AddHours(-1), [Ô]HH:mm:ss[Ô]) & [Ô]-03:00[Ô]) [ô]DATA DE SAIDA
.WriteElementString([Ô]dhSaiEnt[Ô], Format(Me.dhSaiEnt, [Ô]yyyy-MM-dd[Ô]) & [Ô]T[Ô] & Format(Now.AddHours(-1), [Ô]HH:mm:ss[Ô]) & [Ô]-03:00[Ô]) [ô]HORA DE SAIDA

Até agora em ambiente hologação esta passando.
MITSUEDA 19/02/2015 20:36:27
#444624
Elucimar e FoxMan,

Alterei a propriedade para string conforme FoxMan, depois utilizei a formatação que o Elucimar exemplificou porque sempre uso o now para emissão das notas.

Ficou certinho, agora o xml ta chique vamos ver se passa kakaka

Obrigado a todos.
NETODV1 20/02/2015 12:11:10
#444640
Bom tarde pessoal ...

Primeiro gostaria de agradecer ao Elucimar pelo ótimo trabalho no projeto da pág. 170 que estou usando como referência para atualizar o meu.

Consigo enviar o lote com sucesso porém na consulta do mesmo obtenho a seguinte falha [Ô]Unable to handle request. The action [ô]http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao/nfeRetAutorizacaoLote[ô] was not recognized.[Ô].

Já conferí os endereços e estão corretos;
nfeautorizacao:
http://www.portalfiscal.inf.br/nfe/wsdl/NfeAutorizacao/nfeAutorizacaoLote
nferetautorizacao:
http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao/nfeRetAutorizacaoLote

Não consigo localizar o problema.
ELUCIMAR 20/02/2015 12:39:37
#444641
Boa tarde NETODV1 !

Citação:

Primeiro gostaria de agradecer ao Elucimar pelo ótimo trabalho no projeto da pág. 170 que estou usando como referência para atualizar o meu.


Estamos aqui para ajudar os nossos colegas desenvolvedores.

Se você estiver gerando de SP estas Urls estão incorretas:

Homologação:
https://homologacao.nfe.fazenda.sp.gov.br/ws/nfeautorizacao.asmx
https://homologacao.nfe.fazenda.sp.gov.br/ws/nferetautorizacao.asmx

Produção:
https://nfe.fazenda.sp.gov.br/ws/nfeautorizacao.asmx
https://nfe.fazenda.sp.gov.br/ws/nferetautorizacao.asmx
NETODV1 20/02/2015 12:57:53
#444642
Elucimar estou gerando para o RJ que usa as webservices do RS.
Ainda estou em fase de teste só homologação.

[Ô]https://homologacao.nfe.sefazvirtual.rs.gov.br/ws/NfeAutorizacao/NFeAutorizacao.asmx[Ô]
[Ô]https://homologacao.nfe.sefazvirtual.rs.gov.br/ws/NfeRetAutorizacao/NFeRetAutorizacao.asmx[Ô]

Estou usando seu algoritmo convertido para VB:

Namespace RetAutorizacao

[ô][ô][ô] <remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute([Ô]System.Web.Services[Ô], [Ô]4.0.30319.1[Ô])> _
<System.Diagnostics.DebuggerStepThroughAttribute> _
<System.ComponentModel.DesignerCategoryAttribute([Ô]code[Ô])> _
<System.Web.Services.WebServiceBindingAttribute(Name:=[Ô]NfeRetAutorizacaoSoap12[Ô], [Namespace]:=[Ô]http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao[Ô])> _
Partial Public Class NfeRetAutorizacao
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol

Private nfeCabecMsgValueField As nfeCabecMsg

Private nfeRetAutorizacaoLoteOperationCompleted As System.Threading.SendOrPostCallback

Private useDefaultCredentialsSetExplicitly As Boolean

[ô][ô][ô] <remarks/>
Public Sub New(urlRef As String)
Me.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12
Me.Url = urlRef
If (Me.IsLocalFileSystemWebService(Me.Url) = True) Then
Me.UseDefaultCredentials = True
Me.useDefaultCredentialsSetExplicitly = False
Else
Me.useDefaultCredentialsSetExplicitly = True
End If
End Sub

Public Property nfeCabecMsgValue() As nfeCabecMsg
Get
Return Me.nfeCabecMsgValueField
End Get
Set(value As nfeCabecMsg)
Me.nfeCabecMsgValueField = Value
End Set
End Property

Public Shadows Property Url() As String
Get
Return MyBase.Url
End Get
Set(value As String)
If (((Me.IsLocalFileSystemWebService(MyBase.Url) = True) AndAlso (Me.useDefaultCredentialsSetExplicitly = False)) AndAlso (Me.IsLocalFileSystemWebService(Value) = False)) Then
MyBase.UseDefaultCredentials = False
End If
MyBase.Url = Value
End Set
End Property

Public Shadows Property UseDefaultCredentials() As Boolean
Get
Return MyBase.UseDefaultCredentials
End Get
Set(value As Boolean)
MyBase.UseDefaultCredentials = Value
Me.useDefaultCredentialsSetExplicitly = True
End Set
End Property

[ô][ô][ô] <remarks/>
Public Event nfeRetAutorizacaoLoteCompleted As nfeRetAutorizacaoLoteCompletedEventHandler

[ô][ô][ô] <remarks/>
<System.Web.Services.Protocols.SoapHeaderAttribute([Ô]nfeCabecMsgValue[Ô], Direction:=System.Web.Services.Protocols.SoapHeaderDirection.InOut)> _
<System.Web.Services.Protocols.SoapDocumentMethodAttribute([Ô]http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao/nfeRetAutorizacaoLote[Ô], Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
Public Function nfeRetAutorizacaoLote(<System.Xml.Serialization.XmlElementAttribute([Namespace]:=[Ô]http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao[Ô])> nfeDadosMsg As System.Xml.XmlNode) As <System.Xml.Serialization.XmlElementAttribute([Namespace]:=[Ô]http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao[Ô])> System.Xml.XmlNode
Dim results As Object() = Me.Invoke([Ô]nfeRetAutorizacaoLote[Ô], New Object() {nfeDadosMsg})
Return DirectCast(results(0), System.Xml.XmlNode)
End Function

[ô][ô][ô] <remarks/>
Public Sub nfeRetAutorizacaoLoteAsync(nfeDadosMsg As System.Xml.XmlNode)
Me.nfeRetAutorizacaoLoteAsync(nfeDadosMsg, Nothing)
End Sub

[ô][ô][ô] <remarks/>
Public Sub nfeRetAutorizacaoLoteAsync(nfeDadosMsg As System.Xml.XmlNode, userState As Object)
If (Me.nfeRetAutorizacaoLoteOperationCompleted Is Nothing) Then
Me.nfeRetAutorizacaoLoteOperationCompleted = New System.Threading.SendOrPostCallback(AddressOf Me.OnnfeRetAutorizacaoLoteOperationCompleted)
End If
Me.InvokeAsync([Ô]nfeRetAutorizacaoLote[Ô], New Object() {nfeDadosMsg}, Me.nfeRetAutorizacaoLoteOperationCompleted, userState)
End Sub

Private Sub OnnfeRetAutorizacaoLoteOperationCompleted(arg As Object)
If (Me.nfeRetAutorizacaoLoteCompletedEvent IsNot Nothing) Then
Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = DirectCast(arg, System.Web.Services.Protocols.InvokeCompletedEventArgs)
RaiseEvent nfeRetAutorizacaoLoteCompleted(Me, New nfeRetAutorizacaoLoteCompletedEventArgs(invokeArgs.Results, invokeArgs.[Error], invokeArgs.Cancelled, invokeArgs.UserState))
End If
End Sub

[ô][ô][ô] <remarks/>
Public Shadows Sub CancelAsync(userState As Object)
MyBase.CancelAsync(userState)
End Sub

Private Function IsLocalFileSystemWebService(url As String) As Boolean
If ((url Is Nothing) OrElse (url = String.Empty)) Then
Return False
End If
Dim wsUri As New System.Uri(url)
If ((wsUri.Port >= 1024) AndAlso (String.Compare(wsUri.Host, [Ô]localHost[Ô], System.StringComparison.OrdinalIgnoreCase) = 0)) Then
Return True
End If
Return False
End Function
End Class

[ô][ô][ô] <remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute([Ô]System.Xml[Ô], [Ô]4.0.30319.1[Ô])> _
<System.SerializableAttribute> _
<System.Diagnostics.DebuggerStepThroughAttribute> _
<System.ComponentModel.DesignerCategoryAttribute([Ô]code[Ô])> _
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:=[Ô]http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao[Ô])> _
<System.Xml.Serialization.XmlRootAttribute([Namespace]:=[Ô]http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao[Ô], IsNullable:=False)> _
Partial Public Class nfeCabecMsg
Inherits System.Web.Services.Protocols.SoapHeader

Private cUFField As String

Private versaoDadosField As String

Private anyAttrField As System.Xml.XmlAttribute()

[ô][ô][ô] <remarks/>
Public Property cUF() As String
Get
Return Me.cUFField
End Get
Set(value As String)
Me.cUFField = Value
End Set
End Property

[ô][ô][ô] <remarks/>
Public Property versaoDados() As String
Get
Return Me.versaoDadosField
End Get
Set(value As String)
Me.versaoDadosField = Value
End Set
End Property

[ô][ô][ô] <remarks/>
<System.Xml.Serialization.XmlAnyAttributeAttribute> _
Public Property AnyAttr() As System.Xml.XmlAttribute()
Get
Return Me.anyAttrField
End Get
Set(value As System.Xml.XmlAttribute())
Me.anyAttrField = Value
End Set
End Property
End Class

[ô][ô][ô] <remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute([Ô]System.Web.Services[Ô], [Ô]4.0.30319.1[Ô])> _
Public Delegate Sub nfeRetAutorizacaoLoteCompletedEventHandler(sender As Object, e As nfeRetAutorizacaoLoteCompletedEventArgs)

[ô][ô][ô] <remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute([Ô]System.Web.Services[Ô], [Ô]4.0.30319.1[Ô])> _
<System.Diagnostics.DebuggerStepThroughAttribute> _
<System.ComponentModel.DesignerCategoryAttribute([Ô]code[Ô])> _
Partial Public Class nfeRetAutorizacaoLoteCompletedEventArgs
Inherits System.ComponentModel.AsyncCompletedEventArgs

Private results As Object()

Friend Sub New(results As Object(), exception As System.Exception, cancelled As Boolean, userState As Object)
MyBase.New(exception, cancelled, userState)
Me.results = results
End Sub

[ô][ô][ô] <remarks/>
Public ReadOnly Property Result() As System.Xml.XmlNode
Get
Me.RaiseExceptionIfNecessary()
Return DirectCast(Me.results(0), System.Xml.XmlNode)
End Get
End Property
End Class

End Namespace
ELUCIMAR 20/02/2015 13:27:52
#444644
O estranho que já uso essa classe de busca do Retorno da autorização da NFe já tem um tempinho e nunca me retornou esse erro. As vezes o programa que você usou para converter não converteu corretamente. Gerei uma classe no VS em VB.NET do Webservice do Retorno da autorização. Faz uma tentativa substitui a sua Classe por esta.
TINTINO 20/02/2015 14:16:00
#444648
Boa Tarde Pessoal, será que alguém poderia disponibilizar o projeto em VBNET na versão 3.0.

Abraço

Edvaldo
Página 181 de 228 [2276 registro(s)]
Faça seu login para responder