Jump to content
Seja Membro VIP - Remova Banners de Propagandas, Tenha Liberado Qualquer Download, Além de Acessos em Áreas Exclusivas!! ×

Recommended Posts


  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Content Per Day:  0.00
  • Reputation:   0
  • Achievement Points:  15
  • Solved Content:  0
  • Days Won:  0
  • Status:  Offline
  • Device:  Windows

Posted

Boa tarde a todos.

Usando o Visual Studio 2019, estou fazendo um projeto em MVC 6 onde preciso consumir um WebService do TOTVS RM, porém sempre que tento fazer a autenticação ou utilizar qualquer método, o sistema me retorna com a mensagem:

MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Basic'. The authentication header received from the server was '*'.

 

Abaixo meu código em .Net:

 

 BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
            var endPoint = new EndpointAddress("http://XXXXXXXX:8051/wsConsultaSQL/IwsBase");

            var cliente = new IwsBaseClient(binding, endPoint); 
            
            cliente.ClientCredentials.Windows.ClientCredential.UserName = codUsuario;
            cliente.ClientCredentials.Windows.ClientCredential.Password = senha;
            cliente.ClientCredentials.UserName.UserName = codUsuario;
            cliente.ClientCredentials.UserName.Password = senha;
            cliente.ChannelFactory.Open(new TimeSpan(5, 59, 59));
            

            await cliente.AutenticaAcessoAsync();

 

Desde já agradeço.

  • 4 years later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic


  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Content Per Day:  0.00
  • Reputation:   1
  • Achievement Points:  62
  • Solved Content:  0
  • Days Won:  0
  • Status:  Offline
  • Device:  iPhone

Posted

Boa noite, conseguiu de alguma forma?

 

  • 7 months later...

  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  353
  • Content Per Day:  0.06
  • Reputation:   8
  • Achievement Points:  2,152
  • Solved Content:  0
  • Days Won:  4
  • Status:  Offline
  • Age:  18

Posted

Seu tópico foi movido para outra área no ForumRM

Mudamos o mesmo de: Sistemas RM > [RM] Manuais Tutoriais e Roteiros

Para o fórum: Sistemas RM > [RM] Framework (FV, MD, Conceitos, entre outros)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.