2010-10-25 44 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

回答

相关问题