簡體   English   中英

WCF服務使用中需要幫助

[英]Needed help in wcf service consuming

我在IIS上托管了此WCF服務。 當我嘗試使用下面的代碼在客戶端項目中使用它時,出現以下異常“發送請求時發生錯誤”

LaunchService.LaunchServiceClient launchServiceClient =
            new LaunchService.LaunchServiceClient(
            new BasicHttpBinding(),
            new EndpointAddress("http:// Service base address"));

如果我在以上代碼WebHttpBinding() BasicHttpBinding()更改為WebHttpBinding() (如在我的web.config文件中), WebHttpBinding()收到此錯誤

“ System.TypeLoadException:'無法從程序集'System.ServiceModel.Web,版本= 4.0.0.0,區域性=中性,PublicKeyToken = 31bf3856ad364e35'中加載類型'System.ServiceModel.WebHttpBinding'。'”

使用默認構造函數時,出現此錯誤

“ System.PlatformNotSupportedException:不支持配置文件。”

LaunchService.LaunchServiceClient launchService =新的LaunchService.LaunchServiceClient();

我嘗試更改Web配置文件中的設置,但是其中的任何更改都無法使服務正常工作。

有什么幫助嗎?

提前致謝..

當我在核心項目中添加.net項目(“具有服務”)的引用時,出現了此問題

解決方案:刪除.net項目並添加新的核心項目

注意:初始化服務時,必須修改某些實現

暫無
暫無

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

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