SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am facing a strange issue. It looks like silly but it took lot of time to figure it out.But still i do not find solution.

I am fetching few of few data sources(connecting to 3rd party web service) on page load of web part(share point 2013 version).

In order to connect 3rd party web service, we are passing one of header value(Key) which is provided by the web service provider from IClientMessageInspector.BeforeSendRequest using custom endpoint behavior. Then we are adding the custom endpoint to service client endpoint before making any service client method call.

The code is working fine when i put up a break point and try to debug and run the page but when i try to run from the site pages directly i am getting error as "The remote server returned an error: (403) Forbidden." In order to avoid 403 error we are sending the header value which works well for us.

Even from a sample site page or console app (with the header value) we are able to get data from web service.

I could not find any solution from search.Please help me out. Thanks.

share|improve this question
What credentials are you using to access the web service?. It sounds like you are hitting the double hop issue. Have you got Kerberos enabled or are you using NTLM for your web service binding? – Simon Doy Feb 6 '13 at 18:59
We are not passing any credentials to the web service. Only we are sending one header key with the request. Just we have the web service link, which has some default binding information added when we add service reference and on top that we are sending one of header value for each service client call. please help me on this. – Feb 7 '13 at 5:03
Sorry I've just re-read the question and its a 403 - Forbidden error rather than 401 - Unauthorised. My thoughts aren't going to help. – Simon Doy Feb 7 '13 at 9:08
Have you tried running the console app from the actual SharePoint server which is executing the page request? How about running Fiddler to see what the traffic is coming back and forth. – Simon Doy Feb 7 '13 at 9:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.