locked
Custom Web Service RRS feed

  • Question

  • Dera all,

     

    I tried to follow the example in the SDK to write a sharepoint custom web service and it works well in debug mode.

     

    However, when I run the web application normally to call custom web service, I got the following error

     

    The request failed with HTP status 401: Unauthorized.

     

    What shall I do to fix it?

     

    The purpose of the project is to let people enter project incidents details throught our company web site and save the data in the sharepoint site through calling the web service.

     

     

    Please help.

     

    Thanks

    Monday, April 14, 2008 11:35 AM

Answers

  • You must pass the user credentials to web service call. Pass NetworkCredential.DefaultCredential  or new NetworkCredential to your web reference proxy object. otherwise you will get access denied.

    Monday, April 14, 2008 2:25 PM
  •  

    Thanks. I passed the new NetworkCredential and it works now.

     

     

    Monday, April 14, 2008 2:27 PM

All replies

  • You must pass the user credentials to web service call. Pass NetworkCredential.DefaultCredential  or new NetworkCredential to your web reference proxy object. otherwise you will get access denied.

    Monday, April 14, 2008 2:25 PM
  •  

    Thanks. I passed the new NetworkCredential and it works now.

     

     

    Monday, April 14, 2008 2:27 PM
  • please mark it as ansewered , thanks.

     

    Monday, April 14, 2008 2:28 PM