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

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

Posted

Boa noite, conseguiu de alguma forma?

 

  • 7 months later...

  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  364
  • Content Per Day:  0.06
  • Reputation:   13
  • Achievement Points:  2,232
  • Solved Content:  0
  • Days Won:  5
  • Status:  Offline
  • Age:  19

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)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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