• Register
0 votes
279 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

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 15 views
0 votes
1 answer 429 views
429 views
Problem : We upgraded to TFS 2017 and our API calls stopped working and we started receiving following error: "TF400813: Resource not available for anonymous access. Client authentication required.". Anything in [] brackets was replaced. I amt don't know ... {maxBuildCount}").Result; var myresult = myresponse.Content.ReadAsStringAsync().Result; return (JArray)JObject.Parse(myresult)["value"]; }
asked Dec 4, 2019 alecxe 7.5k points
0 votes
1 answer 103 views
103 views
Problem : I really thought that I had this issue fixed, but it was just disguised before. I have the WCF service hosted in my IIS 7 using HTTPS. When I try to browse to this site in the Internet Explorer, it works like a charm, As I have already added the ... used to work with http. Where else should I look as I am completely exhausted I tried all possibilities as to why I am unable to connect?
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 11 views
11 views
Is there a standard algorithm or best practice on how to implement GetHashCode for my custom classes?
asked Aug 31 Sofi55 1.1k points