• Register
0 votes
388 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 18 views
0 votes
1 answer 547 views
547 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 122 views
122 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 16 views
16 views
Is there a standard algorithm or best practice on how to implement GetHashCode for my custom classes?
asked Aug 31, 2020 Sofi55 1.1k points
0 votes
1 answer 91 views
91 views
Problem: I am trying to consume a PHP webservice which has the SSL certificate. I have the .net 3.5 Class library it references the webservice with a 'Add Service references' in Visualstudio 2010 If I try calling the main method of my webservice then I ... SslPolicyErrors sslPolicyErrors) { return true; } But somehow it is not working. Also I have already a certificate installed on my own pc.
asked Aug 12, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 2 views
2 views
Problem: metadata publishing for this service is currently disabled.
asked 6 days ago charles mathews 3.8k points
0 votes
1 answer 3 views
3 views
Problem: an error occurred when verifying security for the message.
asked 2 days ago Dan phillip 1.9k points
0 votes
1 answer 105 views
105 views
Problem : I am trying to use the WCF4.0 template -REST. Also I am trying to make the method that uploads a file using the stream. The problem always occur at below line of code: Stream myserverStream = myrequest.GetRequestStream() ... connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
asked Dec 10, 2019 alecxe 7.5k points