小编sud*_* pk的帖子

为什么 .net 核心不支持 TransportWithMessageCredential?

我正在尝试在 .net core 中使用 SOAP 服务

我想将安全模式的基本 httpbinding 设置为 TransportWithMessageCredential

和 clientcredentialType 作为证书

但我收到一个错误

在此上下文中,绑定安全属性“securityMode”不支持值“TransportWithMessageCredential”。

代码看起来像这样

var client = new SoapCustomClient();

var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
client.ClientCredentials.ClientCertificate.Certificate = certCollection[0];
Run Code Online (Sandbox Code Playgroud)

我在这里犯了一些严重的错误吗?任何解决方案?

[我能够在 .net 框架中实现这一点,但不能在 .net 核心中实现]

c# wcf soap client-certificates .net-core

10
推荐指数
1
解决办法
4306
查看次数

在MVC4中使用DotNetOpenAuth的完整个人资料

我的MVC4应用程序允许使用LinkedIn帐户登录.我想从登录用户的linkedIn中提取所有可用的详细信息.目前我做了以下工作.

在My AuthConfig.cs中,

  Dictionary<string, object> linkedInExtraData = new Dictionary<string, object>();           
        linkedInExtraData.Add("Icon", "../Images/linkedIn.png");          
        OAuthWebSecurity.RegisterClient(
          client: new App_Start.LinkedInCustomClient("xxxxxxxxxxxx", "yyyyyyyyyyyyyyy"),
          displayName: "LinkedIn",
          extraData: linkedInExtraData);
Run Code Online (Sandbox Code Playgroud)

在linkedIncustomClient.cs中,来自LinkedIn Developer Kit

public class LinkedInCustomClient : OAuthClient
{
    private static XDocument LoadXDocumentFromStream(Stream stream)
    {
        var settings = new XmlReaderSettings
        {
            MaxCharactersInDocument = 65536L
        };
        return XDocument.Load(XmlReader.Create(stream, settings));
    }


    /// Describes the OAuth service provider endpoints for LinkedIn.
    private static readonly ServiceProviderDescription LinkedInServiceDescription =
            new ServiceProviderDescription
            {
                AccessTokenEndpoint =
                        new MessageReceivingEndpoint("https://api.linkedin.com/uas/oauth/accessToken",
                        HttpDeliveryMethods.PostRequest),
                RequestTokenEndpoint =
                        new MessageReceivingEndpoint("https://api.linkedin.com/uas/oauth/requestToken?scope=r_fullprofile",
                        HttpDeliveryMethods.PostRequest),
                UserAuthorizationEndpoint = …
Run Code Online (Sandbox Code Playgroud)

oauth linkedin asp.net-mvc-4

7
推荐指数
1
解决办法
5520
查看次数

如何在不使用fql的情况下获取发布网址的Facebook喜欢,分享和评论数量?

我需要通过post url("www.example.com/exampleblog")而不使用fql来获取facebook,分享和评论计数(因为v2.1不支持fql).

我不想要下面的一个

 https://graph.facebook.com/fql?q=SELECT url, 
share_count, like_count, comment_count, 
total_count,commentsbox_count, comments_fbid, 
click_count FROM link_stat WHERE url='http://example.example.com/'
Run Code Online (Sandbox Code Playgroud)

任何人都可以建议替代上述,支持api v2.1?

facebook social-media facebook-fql facebook-graph-api facebook-graph-api-v2.0

6
推荐指数
1
解决办法
2522
查看次数

如何使用route属性绑定WebAPI GET请求中的请求模型?

GET :http://www.Example.com/Api/1/0/Book/Company/0 

[Route("{UserId}/{Category}/books/{BookType}/{Page}")]
        [HttpGet]
        [RequestAuthorization]
         public Response Get(int UserId,string Category, string BookType,int Page )
        {          
            var books= this.contentService.GetUserItems(UserId,Category, BookType, Page)
            return new Response() { Status = ApiStatusCode.Ok, Books = books};
        }
Run Code Online (Sandbox Code Playgroud)

上面的代码对我很有用.

我的问题是可以在GET请求中绑定请求模型吗?

例如,我有一个这样的请求模型

 public class BookbRequestModel
    {
        public int UserId { get; set; }
        public int Category { get; set; }
        public int Page { get; set; }  
        public string BookType { get; set; }       
    }
Run Code Online (Sandbox Code Playgroud)

我想要这样的获取请求

GET :http://www.Example.com/Api/1/0/Book/Company/0 

to bind the data to my request model


[Route("{UserId}/{Category}/books/{BookType}/{Page}")]
        [HttpGet] …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc get asp.net-web-api

5
推荐指数
1
解决办法
7593
查看次数

任何人都可以告诉我如何安排以csv格式导出salesforce报告

我有一份销售人员报告,我想要的是每天以csv格式安排此报告,以便用户使用此附件获取邮件.

salesforce

4
推荐指数
1
解决办法
3027
查看次数