开发者

How to make a call to secured web service(HTTPS) using basic http binding?

I need to import some model file into a Sharepoint central admin(HTTPS) from my local machine. What should be the configuration(using service.model)? I am using the following configuration...

开发者_开发技巧 binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_BusinessDataCatalogSharedService" contract="BusinessDataCatalogSharedService" name="BasicHttpBinding_BusinessDataCatalogSharedService" />

And i am using the following c# code... BusinessDataCatalogSharedServiceClient client = new BusinessDataCatalogSharedServiceClient("BasicHttpBinding_BusinessDataCatalogSharedService1"); client.ClientCredentials.UserName.UserName = "..."; client.ClientCredentials.UserName.Password = "....";

I am getting the following error

MessageSecurityException was unhandeled The HTTP request was forbidden with client authentication scheme 'Basic'.

I dont have enough knowledge about the authentication...Please help me out.

Thanks


Take a look at this information http://blog.adnanmasood.com/2008/07/16/https-with-basichttpbinding-note-to-self/


Most likely the problem is that you are running the service over HTTP not HTTPS. This will not work with username/password authentication. WCF is secure by default such that it will disallow calls with this type of authentication over HTTP.

You need to configure your service with a certificate to run over HTTPS and then also make the appropriate changes to you config (as is described in the link renu has posted).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜