Hello!
I create client for WinRT and when I try connect to 1C web-service have error like: "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="1C:Enterprise 8.2"'."
I use Windows Store template in visual studio 2012 for C#, and Service Reference that I create using Add Service Reference from 1C WSDL.
Code example:
Code |
---|
private void BtnCompany_Click(object sender, RoutedEventArgs e) { restcoachPortTypeClient Service = new restcoachPortTypeClient(); Service.ClientCredentials.UserName.UserName = "web"; Service.ClientCredentials.UserName.Password = "12345"; Service.ClientCredentials.HttpDigest.ClientCredential.UserName = "web"; Service.ClientCredentials.HttpDigest.ClientCredential.Password = "12345"; Service.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("web","12345",""); Service.OpenAsync(); System.Threading.Tasks.Task<PingResponse> PingAsync = Service.PingAsync(); PingResponse PingResult = PingAsync.Result; Service.CloseAsync(); } |
Please help me to solve this problem.
What I doing wrong?
Best regards, Sergey!