0

WinRTでは、クライアント証明書をSOAPクライアント要求に添付できますか?以前のバージョンでは あなたは単にだろう:WinRT UWPクライアント証明書をWebサービス要求に添付する

MyServiceSoapClient client = new MyServiceSoapClient() 
X509Certificate2 cert = CertificateHelper.GetClientCertificate(); 
client.ClientCredentials.ClientCertificate.Certificate = cert; 

しかしClientCertificateプロパティは、もはや利用可能ではないようです。 UWPでこれをどのように達成できますか?

ありがとうございます。

答えて

0

これを試してみてください。

var client = new ServiceClient(); 
client.Endpoint.Address = new EndpointAddress(url); 

BasicHttpBinding binding = client.Endpoint.Binding as BasicHttpBinding; 
binding.Security.Mode = BasicHttpSecurityMode.Transport; 
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate; 

client.ClientCredentials.ClientCertificate.Certificate = ... 

あなたはあなたの要件に合うように証明書を編集することができる:)

サービスクライアントのマニュアルを https://msdn.microsoft.com/en-ca/library/mt185502.aspx

を参照してください: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f1b8ef52-8c3e-417c-94b9-ba2a545e9beb/uwp-app-making-soap-call-requiring-clientcredential?forum=wpdevelop

+0

おかげで - しかし、それ私が試していたのと同じことです。問題は、ClientCredentialsがClientCertificateプロパティを持っていないことです。そのスレッドを読み込んだ後、ServiceClientを使用して証明書を使ってWebサービス呼び出しを行うことはできません。誰か他の方法を知っていますか? – Necromesa

+0

これは私がしようとしていることはまだできていないという事実を指しているので、これを答えと記しておきます。私はsoapメッセージを手動で生成し、HttpClientを使用してそれを送信することによってそれを行うことができました。私は本当にサービスの参照を介してそれをやりたかった。 – Necromesa

関連する問題