Consumindo Web Service C Sharp com SSL
28/04/2014
0
Li vários artigos aqui e em outros sites mas nenhum utilizava certificados para autenticação.
O web service que pretendo acesso é o https://nfsejuizdefora-teste.pbh.gov.br:443/bhiss-ws/nfse?wsdl
Minha primeira tentativa foi no C# utilizando o "ADD SERVICE REFERENCE / ADVANCED / ADD WEB REFERENCE"
Na URL em insiro : https://nfsejuizdefora-teste.pbh.gov.br:443/bhiss-ws/nfse?wsdl
No conteúdo ao lado da URL me é apresentado a mensagem :
"Não é possível converter o objeto COM do tipo ''System.__ComObject'' na interface tipo ''Microsoft.VisualStudio.OLE.Interop.IServiceProvider''. Esta operação falhou porque a chamada de QueryInterface no componente COM para a interface com IID ''{6D5140C1-7436-11CE-8034-00AA006009FA}'' falhou devido ao seg"
Alguém sabe como me ajudar !?
Heitor Magaldi
Posts
29/04/2014
Heitor Magaldi
Era algo com a versão ultimate VS2010. Instalei o Express 2013 funcionou perfeitamente.
Valeu
29/04/2014
Heitor Magaldi
03/12/2014
Controlesis Ltda
Alguém já consumiu o Web Service da NFe (Consulta de Status do Web Service), estou utilizando o Visual Studio 2010 com vb.net e windows forms.
link https://nfe.fazenda.sp.gov.br/nfeweb/services/nfestatusservico2.asmx
Tentei até alterar o app.config, mais também não tive sucesso, caso alguém saiba agradeço desde já ?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<binding name="nfestatusservico2Soap12">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</configuration>
Veja o erro que está dando ?
The request was aborted: Could not create SSL/TLS secure channel.
Metadata contains a reference that cannot be resolved: 'https://nfe.fazenda.sp.gov.br/nfeweb/services/nfestatusservico2.asmx'.
The HTTP request was forbidden with client authentication scheme 'Anonymous'.
The remote server returned an error: (403) Forbidden.
If the service is defined in the current solution, try building the solution and adding the service reference again.
Clique aqui para fazer login e interagir na Comunidade :)