4
I already followed the instructions of this question read, reread, and repeated the tutorial by Pedro Gaspar. And I can’t get eSocial webservices referenced by Visual Studio. What I’ve done so far is:
- I installed the chains of certificates, both the 15/01/2014 and the 06/02/2017 in the correct sequence.
- I installed the strings by placing all the certificates in the Root repository of Local Machine
- I installed the chains placing only the Brazilian Root Certification Authority v5 in the Root repository and the others in the intermediate repository.
- I installed the Certificate (valid, not expired and with correct password) of my client in the Personal repository (On Machine Location and Current User)
I can access the web service addresses through the browser and the lock is green. When I try to add service by the visual studio the following occurs:
When making a "Web Reference", the following happens:
See that it accesses WS (because in the browser also accesses) however, still appears Forbidden.
I tried to do by SVCUTIL.EXE and the result was the following:
C:\WINDOWS\system32>svcutil https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.6.1055.0]
Copyright (c) Microsoft Corporation. All rights reserved.
Attempting to download metadata from 'https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl' using WS-Metadata Exchange or DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.6.1055.0]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot obtain Metadata from https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl
If this is a Windows (R) Communication Foundation service to which you have
access, please check that you have enabled metadata publishing at the
specified address. For help enabling metadata publishing, please refer to
the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error
URI: https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl
Metadata contains a reference that cannot be resolved: 'https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl'.
The HTTP request was forbidden with client authentication scheme 'Anonymous'.
The remote server returned an error: (403) Forbidden.
HTTP GET Error
URI: https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl
There was an error downloading 'https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl'.
The request failed with HTTP status 403: Forbidden.
If you would like more help, type "svcutil /?"
C:\WINDOWS\system32>
The messages caught my attention Error: Cannot obtain Metadata...
, Metadata contains a reference that cannot be resolved
and The HTTP request was forbidden with client authentication scheme 'Anonymous'
My possibilities are exhausted, I don’t know what else to test. Someone has a suggestion?
Yes... this is new for me, by the way, it’s new the possibility to put a physical path there in the "Add Service Reference" window, I always thought it could only be URL, I put the WSDL path and it worked! Thank you
– Ewerton
Poxa Ewerton, and the worst thing is that this detail (of using a local path), and also the response of Rovann Linhalis, were written there in my tutorial, which you read and reread several times! But, I know how it is, sometimes despair hits and the answer is in our face and we do not see. ;-)
– Pedro Gaspar