Error to connect WebService (NAV 2013) from Visual Studio

tchusamitchusami Member Posts: 3
edited 2014-04-14 in NAV Three Tier
Hello, I'm trying connect to webservice from Visual Studio with C# and I've a problem with the ClientCredentials.
Error: "The HTTP request doesn't authorized with the client scheme 'Anonymous'".

Can someone help me?

Thank you!

Comments

  • Wisa123Wisa123 Member Posts: 308
    Hi,

    1.) The Webservice runs at the used URL? (Does it work in IE)
    2.) How do you call the webservice? (UseDefaultCredential, via NetworkCredential Object? )
    Can you find an option to set the authentification Mode (ntauthenification) ?

    its been a while since i consumed a nav webservice from .NET, hopefully i helped you a bit.
    Austrian NAV/BC Dev
  • tchusamitchusami Member Posts: 3
    Webservice run in explorer. UseDefaultCredential isn't avaible, only appear ClientCredentials dot UserName or Windows but don't work.

    EDIT: I've solve the problem, solution:
                var binding = new BasicHttpBinding();
                binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
                binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
    

    And "binding" is a parameter for constructor.
Sign In or Register to comment.