Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

KleberEraSyst

NF-e 3.10

Recommended Posts

Eu uso essa Referencia, alguem pode me ajudar por favor



Option Strict Off

Option Explicit On


Imports System

Imports System.ComponentModel

Imports System.Diagnostics

Imports System.Web.Services

Imports System.Web.Services.Protocols

Imports System.Xml.Serialization


Namespace Autorizacao


'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483"), _

System.Diagnostics.DebuggerStepThroughAttribute(), _

System.ComponentModel.DesignerCategoryAttribute("code"), _

System.Web.Services.WebServiceBindingAttribute(Name:="NfeAutorizacaoSoapBinding", [Namespace]:="http://www.portalfiscal.inf.br/nfe/wsdl/NfeAutorizacao")> _

Partial Public Class NfeAutorizacao

Inherits System.Web.Services.Protocols.SoapHttpClientProtocol


Private nfeCabecMsgValueField As nfeCabecMsg


Private nfeAutorizacaoLoteOperationCompleted As System.Threading.SendOrPostCallback


Private useDefaultCredentialsSetExplicitly As Boolean


'''<remarks/>

Public Sub New()

MyBase.New()

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(ByVal value As nfeCabecMsg)

Me.nfeCabecMsgValueField = value

End Set

End Property


Public Shadows Property Url() As String

Get

Return MyBase.Url

End Get

Set(ByVal 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(ByVal value As Boolean)

MyBase.UseDefaultCredentials = value

Me.useDefaultCredentialsSetExplicitly = True

End Set

End Property


'''<remarks/>

Public Event nfeAutorizacaoLoteCompleted As nfeAutorizacaoLoteCompletedEventHandler


'''<remarks/>

<System.Web.Services.Protocols.SoapHeaderAttribute("nfeCabecMsgValue"), _

System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.portalfiscal.inf.br/nfe/wsdl/NfeAutorizacao/nfeAutorizacaoLote", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _

Public Function nfeAutorizacaoLote(<System.Xml.Serialization.XmlElementAttribute([Namespace]:="http://www.portalfiscal.inf.br/nfe/wsdl/NfeAutorizacao")> ByVal nfeDadosMsg As System.Xml.XmlNode) As <System.Xml.Serialization.XmlElementAttribute([Namespace]:="http://www.portalfiscal.inf.br/nfe/wsdl/NfeAutorizacao")> System.Xml.XmlNode

Dim results() As Object = Me.Invoke("nfeAutorizacaoLote", New Object() {nfeDadosMsg})

Return CType(results(0), System.Xml.XmlNode)

End Function


'''<remarks/>

Public Overloads Sub nfeAutorizacaoLoteAsync(ByVal nfeDadosMsg As System.Xml.XmlNode)

Me.nfeAutorizacaoLoteAsync(nfeDadosMsg, Nothing)

End Sub


'''<remarks/>

Public Overloads Sub nfeAutorizacaoLoteAsync(ByVal nfeDadosMsg As System.Xml.XmlNode, ByVal userState As Object)

If (Me.nfeAutorizacaoLoteOperationCompleted Is Nothing) Then

Me.nfeAutorizacaoLoteOperationCompleted = AddressOf Me.OnnfeAutorizacaoLoteOperationCompleted

End If

Me.InvokeAsync("nfeAutorizacaoLote", New Object() {nfeDadosMsg}, Me.nfeAutorizacaoLoteOperationCompleted, userState)

End Sub


Private Sub OnnfeAutorizacaoLoteOperationCompleted(ByVal arg As Object)

If (Not (Me.nfeAutorizacaoLoteCompletedEvent) Is Nothing) Then

Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg, System.Web.Services.Protocols.InvokeCompletedEventArgs)

RaiseEvent nfeAutorizacaoLoteCompleted(Me, New nfeAutorizacaoLoteCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))

End If

End Sub


'''<remarks/>

Public Shadows Sub CancelAsync(ByVal userState As Object)

MyBase.CancelAsync(userState)

End Sub


Private Function IsLocalFileSystemWebService(ByVal url As String) As Boolean

If ((url Is Nothing) _

OrElse (url Is String.Empty)) Then

Return False

End If

Dim wsUri As System.Uri = 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", "2.0.50727.5485"), _

System.SerializableAttribute(), _

System.Diagnostics.DebuggerStepThroughAttribute(), _

System.ComponentModel.DesignerCategoryAttribute("code"), _

System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://www.portalfiscal.inf.br/nfe/wsdl/NfeAutorizacao"), _

System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://www.portalfiscal.inf.br/nfe/wsdl/NfeAutorizacao", IsNullable:=False)> _

Partial Public Class nfeCabecMsg

Inherits System.Web.Services.Protocols.SoapHeader


Private versaoDadosField As String


Private cUFField As String


Private anyAttrField() As System.Xml.XmlAttribute


'''<remarks/>

Public Property versaoDados() As String

Get

Return Me.versaoDadosField

End Get

Set(ByVal value As String)

Me.versaoDadosField = value

End Set

End Property


'''<remarks/>

Public Property cUF() As String

Get

Return Me.cUFField

End Get

Set(ByVal value As String)

Me.cUFField = value

End Set

End Property


'''<remarks/>

<System.Xml.Serialization.XmlAnyAttributeAttribute()> _

Public Property AnyAttr() As System.Xml.XmlAttribute()

Get

Return Me.anyAttrField

End Get

Set(ByVal value As System.Xml.XmlAttribute())

Me.anyAttrField = value

End Set

End Property

End Class


'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")> _

Public Delegate Sub nfeAutorizacaoLoteCompletedEventHandler(ByVal sender As Object, ByVal e As nfeAutorizacaoLoteCompletedEventArgs)


'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483"), _

System.Diagnostics.DebuggerStepThroughAttribute(), _

System.ComponentModel.DesignerCategoryAttribute("code")> _

Partial Public Class nfeAutorizacaoLoteCompletedEventArgs

Inherits System.ComponentModel.AsyncCompletedEventArgs


Private results() As Object


Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal 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 CType(Me.results(0), System.Xml.XmlNode)

End Get

End Property

End Class

End Namespace

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.