Possible SOAP version mismatch - nfe

02/03/2015

0

Pessoal

Tem a rotina abaixo referente ao envio de NFe nfeRecepcao2, e gostaria de saber o que poderia ser, pois até o momento não consegui identificar o que poderia ser ?

No momento estou pesquisando sobre o envio utilizando soap 1.2, utilizando BasicHttpBinding, para mudar para 1.2, só que até o momento nada, e também estou pesquisando sobre WSHttpBinding, pois parece que ele trabalha com a versão 1.2, caso alguém tenha alguma coisa para me ajudar neste sentido agradeço desde já.

Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/soap/envelope/ was unexpected. Expecting http://www.w3.org/2003/05/soap-envelope."

Public Function SendNFeAutorizacao2() As Boolean
Dim f_icRetorno As Boolean = False
Dim f_xmlDados As New XmlDocument
Dim f_objCertificado As X509Certificate2
Dim f_xmlResultado As XmlNode
Dim f_wsCab As New Prod_nfe_2_00.nfeCabecMsg

Dim f_wsTransacional As Prod_nfe_2_00.NfeRecepcao2Soap12Client

Dim f_customBinding As New ServiceModel.Channels.CustomBinding()
Dim f_httpstransport As New ServiceModel.Channels.HttpsTransportBindingElement()
Dim f_BasicHttpBinding As System.ServiceModel.BasicHttpBinding = New System.ServiceModel.BasicHttpBinding

Dim cTeste As String = String.Empty
Try

f_objCertificado = SelecionarCertificado("")
f_wsCab.cUF = 35
f_wsCab.versaoDados = "2.00"

f_httpstransport.RequireClientCertificate = True
f_httpstransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Digest
f_customBinding.Elements.Add(f_httpstransport)

f_BasicHttpBinding.MaxReceivedMessageSize = Int32.MaxValue
f_BasicHttpBinding.MaxBufferSize = Int32.MaxValue
f_BasicHttpBinding.Name = "NfeRecepcao2Soap12"
f_BasicHttpBinding.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport
f_BasicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate

Dim uri As String() = {"https://homologacao.nfe.fazenda.sp.gov.br/nfeweb/services/NfeRecepcao2.asmx" _
, "https://nfe.fazenda.sp.gov.br/nfeweb/services/nferecepcao2.asmx"}
Dim endpointAddress As New ServiceModel.EndpointAddress(uri(0))

f_wsTransacional = New Prod_nfe_2_00.NfeRecepcao2Soap12Client(f_BasicHttpBinding, endpointAddress)
f_wsTransacional.Endpoint.Binding = f_BasicHttpBinding
f_wsTransacional.Endpoint.Address = endpointAddress
f_wsTransacional.Endpoint.Name = "NfeRecepcao2Soap12"
f_wsTransacional.Endpoint.Contract.Name = "nfeweb.services.nferecepcao2Soap12"
f_wsTransacional.ClientCredentials.ClientCertificate.Certificate = f_objCertificado

f_xmlDados.Load("D:\base\xml_nfe\assinada\NFe_000000582.xml")

'o erro está dando na linha abaixo
f_xmlResultado = f_wsTransacional.nfeRecepcaoLote2(f_wsCab, f_xmlDados)

cTeste = "ok"

Catch ex As Exception
cTeste = ex.Message

End Try
cTeste = "ok"
Return f_icRetorno
End Function
Controlesis Ltda

Controlesis Ltda

Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar