How do I call a Sharepoint Webservice from a c# cl

2019-04-10 05:46发布

We have developed a webservice that sits and runs in the context of a sharepoint site. This works fine using normal windows authentication.

We now have a client who wants to install this on a Kerberos enabled sharepoint site. What changes would we need to make to either the webserivce, the calling client (a windows service) or both to enable this...?

1条回答
别忘想泡老子
2楼-- · 2019-04-10 05:57

Is this in an intranet?

If so, and your client is already passing windows credentials to the web service, you shouldn't have to do any additional work.

If you aren't passing windows credentials, here is how to do it :

WebServiceProxy proxy = new WebServiceProxy(); // Derived from SoapHttpClientProtocol

proxy.Credentials = CredentialCache.DefaultCredentials;

This method works for both NTLM and Kerberos authentication. It will pass the credentials of the windows account under which the code is running.

查看更多
登录 后发表回答