2010-10-25 49 views
2

我在玩創建演示棱鏡應用程序。我有的應用程序有一個shell項目和另一個模塊,它有一個棱鏡服務和一個視圖(和一個視圖模型)。 (主要基於Mike Taulty的視頻,但是以WPF而不是Silverlight)。調用Web服務時,Prism可以模塊化嗎?

我設置了棱鏡服務來調用我的web服務。似乎所有設置正確的,但是當我把這個代碼:

MyServiceReferenceClient myServiceReferenceClient = new MyServiceReferenceClient(); 

我得到這個錯誤:

Could not find default endpoint element that references contract 'MyServiceReference.IMyService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

我一派錯誤和發現,我需要把我的app.config的內容進入我的shell項目中以使其工作。

我將該文件複製到我的Shell項目中,它工作得很好。

但我不喜歡這樣。棱鏡的想法是模塊化的。如果必須引用模塊中調用的所有Web服務,那麼shell必須比每個模塊更瞭解每個模塊的內部工作原理。

有沒有一種方法可以在模塊中調用Web服務,並仍然具有模塊(通過配置文件)和區域作爲shell唯一需要了解的模塊的優點?

+0

你正在得到什麼錯誤 – TalentTuner 2010-10-25 03:45:30

+0

@saurabh - 當我嘗試創建客戶端時失敗。我會得到確切的消息並更新問題。 – Vaccano 2010-10-25 03:47:26

+0

@saurabh - 我添加了錯誤信息。 – Vaccano 2010-10-25 03:58:12

回答

相關問題