• Register
0 votes
515 views

Problem :

I have created one of the WCF service and deployed it on the Server. When I browse this service it gives me positive response with the wsdl URL. Now I am trying to test my service through the WCF Test client. It shows me proper metadata. But when I try to invoke any of my method from a service it shows me the exception. Below are the error details with stack trace..

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.

The Server stack trace :

at
System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory factory)
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.

 

7 5 2
3,870 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I did not have the control over my security configuration for a service I was calling into, but got a same error. I was able to fix my client as shown below :

1.In your config, set up the security mode as shown below :

<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>

2.In your code, set up the proxy class to allow impersonation (I have added the reference to a service called customer) as shown below :

Customer_PortClient proxy = new Customer_PortClient();
proxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

 

9 7 4
38,600 points

Related questions

0 votes
1 answer 10 views
10 views
Problem: I'm having trouble finding a solution; could you please assist me? The http request was forbidden with client authentication scheme 'anonymous'.
asked Apr 6 tuhin1 48.9k points
0 votes
1 answer 5 views
5 views
Problem: While calling a web service I get the following error: The HTTP request is unauthorized with client authentication scheme 'NTLM'. The authentication header received from the server was 'NTLM'. The HTTP request is unauthorized with client ... <binding name="ClNtlmBinding"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security> </binding>
asked May 1 anika11 32.2k points
0 votes
1 answer 5 views
5 views
Problem: I'm getting this error when I try and access my website:-No authentication protocol including anonymous is selected in is?I have to use Anonymous authentication only, can anyone help please?
asked Apr 11 Sana8989 8.9k points
0 votes
1 answer 10 views
10 views
Problem: I've a WCF service using windows authentication: This service is available via an https://subdomain.mydomain.com/MyService.svc The current configuration is: <netTcpBinding> <binding name="SecureNetTcpBinding"> <security mode="Transport"> <transport clientCredentialType=" ... the windows authentication, and don't need to have a connection to the Domain controller. It works with VPN closed.
asked Apr 26 ochena 23.3k points
0 votes
1 answer 7 views
7 views
Problem: when I try to run it on Windows 7 it gives me the following error: System.ServiceModel.CommunicationException: An error occurred while making the HTTP request to https://nfce-homologacao.svrs.rs.gov.br/ws/NfeStatusServico/NfeStatusServico2.asmx.
asked Apr 11 ummesalma 29.2k points
0 votes
1 answer 19 views
0 votes
1 answer 1 view
1 view
Problem: HELP! I need help understanding this error > The request failed with http status 401 unauthorized reporting services
asked 6 days ago ummeshani 10.8k points
0 votes
1 answer 4 views
4 views
Problem: I tried to access the service from client application.I got ,SecurityNegotiationException.If I host the service on an ASP.NET development server, it works well, but if I host on IIS, the above mentioned error occurs.
asked Apr 26 Humaira ahmed 50.7k points
0 votes
1 answer 2 views
2 views
Problem: I have a simple problem. I've created a WCF Data Service 5.6 in visual studio 2013, and in its *.svc.cs file, But when I want to see the service in the browser it gives me the following error Request Error: The server encountered an error processing the request. See server logs for more details
asked Apr 25 ummeshani 10.8k points