簡體   English   中英

具有證書身份驗證的WCF服務參考

[英]WCF service reference with certificate authentication

我已經提供了一個wcf服務網址,專用證書和公用證書來使用它。

My url is https:/xxxx.com/xxxx/xxxx.svc
my private certificate is xxx.pfx
my public certificate is xxxx.cer

當我嘗試從客戶端應用程序添加服務引用時,它將引發以下錯誤。

There was an error downloading 
'https://xxxx.com/xxxx/xxxx.svc'.
The underlying connection was closed: 
An unexpected error occurred on a receive.
Unable to read data from the transport connection: 
An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Metadata contains a reference that cannot be resolved: 
'https://xxxx.com/xxxx/xxxx.svc'.
An error occurred while receiving the HTTP response to   
https://xxxx.com/xxxx/xxxx.svc. 
This could be due to the service endpoint binding not using the HTTP protocol. 
This could also be due to an HTTP request context being aborted by the server 
(possibly due to the service shutting down).   
See server logs for more details.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection:
An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
If the service is defined in the current solution, 
try building the solution and adding  the service reference again.

我將證書安裝在個人,受信任的人,受信任的發布者文件夾下。 我無權訪問服務器以檢查服務器配置。 但是我被告知這適用於不同的客戶。 我確定我搞砸了證書的安裝。 如果有人能指出我正確的方向,那就太好了。

謝謝,

也先

您必須啟用跟蹤以查看服務器上發生的情況。 您發布的錯誤消息更為通用。

http://msdn.microsoft.com/en-us/library/ff648360.aspx http://msdn.microsoft.com/en-us/library/ms733025.aspx

首先,只需嘗試從項目中刪除服務引用,從web.config中刪除system.ServiceModel部分,然后再次添加服務引用。 這將強制VS完全重建system.ServiceModel部分。 如果這樣做沒有幫助,則需要其他wcf客戶端配置。 這是一個很好的示例,說明如何正確配置wcf客戶端以使用證書:

http://www.codeproject.com/Articles/28248/Securing-WCF-Services-with-Certificates

如果在此之后您仍然遇到問題,則可能會缺少一些自定義的EndpointBehavior。 在這種情況下,您應該聯系wcf服務提供商。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM