I've already followed the instructions of this question li, reli, and have re-read the Pedro Gaspar tutorial several times. And I can not reference the eSocial webservices through Visual Studio. What I've done so far was:
- I installed the certificate chains, both on 1/15/2014 and 06/02/2017 in the correct sequence.
- I installed the chains by putting all the certificates in the Local Machine Root repository
- I installed the chains by placing only the Brazilian Root Certification Authority v5 in the Root repository and the rest in the broker repository.
- I installed the certificate (valid, not expired and with the correct password) from my client in the Personal repository (On the local Machine and the Current User)
I can access the webservices addresses through the browser and the padlock turns green. When I try to add service reference through visual studio the following occurs:
Whendoinga"Web Reference", the following happens:
SeethatitaccessestheWS(sinceinthebrowseritalsoaccesses),buttheforbiddenstillappears.
ItriedtodoitthroughSVCUTIL.EXEandtheresultwasasfollows:
C:\WINDOWS\system32>svcutilhttps://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdlMicrosoft(R)ServiceModelMetadataTool[Microsoft(R)Windows(R)CommunicationFoundation,Version4.6.1055.0]Copyright(c)MicrosoftCorporation.Allrightsreserved.Attemptingtodownloadmetadatafrom'https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl'usingWS-MetadataExchangeorDISCO.Microsoft(R)ServiceModelMetadataTool[Microsoft(R)Windows(R)CommunicationFoundation,Version4.6.1055.0]Copyright(c)MicrosoftCorporation.Allrightsreserved.Error:CannotobtainMetadatafromhttps://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdlIfthisisaWindows(R)CommunicationFoundationservicetowhichyouhaveaccess,pleasecheckthatyouhaveenabledmetadatapublishingatthespecifiedaddress.Forhelpenablingmetadatapublishing,pleaserefertotheMSDNdocumentationathttp://go.microsoft.com/fwlink/?LinkId=65455.WS-MetadataExchangeErrorURI:https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdlMetadatacontainsareferencethatcannotberesolved:'https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl'.TheHTTPrequestwasforbiddenwithclientauthenticationscheme'Anonymous'.Theremoteserverreturnedanerror:(403)Forbidden.HTTPGETErrorURI:https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdlTherewasanerrordownloading'https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc?singleWsdl'.TherequestfailedwithHTTPstatus403:Forbidden.Ifyouwouldlikemorehelp,type"svcutil /?"
C:\WINDOWS\system32>
I noticed the messages Error: Cannot obtain Metadata...
, Metadata contains a reference that cannot be resolved
and The HTTP request was forbidden with client authentication scheme 'Anonymous'
My chances are exhausted, I do not know what to test. Anyone have a suggestion?