Gets 403 when calling WCF Service in intranet

I got following error message when trying to call a WCF service which is deployed in the intranet from my web site.

 

System.ServiceModel.Security.MessageSecurityException: The HTTP request was forbidden with client authentication scheme 'Negotiate'. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   --- End of inner exception stack trace ---

 

However calling it works just fine in my console application. Then I guess the 403 may from the proxy server, instead of the WCF service, because I configured to use proxy in my web site. So I disabled the proxy by adding following to the binding configuration

useDefaultWebProxy="true"

Everything works fine…

posted @ 2011-12-12 15:17  光阴四溅  阅读(536)  评论(0编辑  收藏  举报