简体   繁体   English

添加了WCF服务,但是MVC 4客户端应用程序中不提供服务引用实例

[英]WCF service is added but, service reference instance is unavaiable into MVC 4 client applicaiton

I have crated WCF service. 我创建了WCF服务。

Service client as - MVC 4 application. 服务客户端为-MVC 4应用程序。 Added - Service reference into MVC 4 applicaiton. 已添加-MVC 4应用程序中的服务参考。

Problem: In client application, unable to find - servicerefernececlient object to access service methods. 问题:在客户端应用程序中,无法找到-servicerefernececlient对象以访问服务方法。

When i add same service reference into asp.net web applicaiton then it works and available to call service method. 当我将相同的服务引用添加到asp.net Web应用程序中时,它将起作用并可以调用服务方法。 But, it is unavailable while access through MVC application. 但是,在通过MVC应用程序访问时不可用。

DETAIL: In my solution there are three projects as follow: 1) WCF Applications ervice 2) ASP.NET Web Application 3) MVC 4 application. 详细信息:在我的解决方案中,有以下三个项目:1)WCF应用程序服务2)ASP.NET Web应用程序3)MVC 4应用程序。

WCF Applicaton service refernec added into both the projects using "Add service reference" . 使用“添加服务引用”将WCF Applicaton服务引用添加到两个项目中。 NOw, service reference instance is available into ASP.NET WEB applicaiton but, its not available into MVC 4 applicaiton. 现在,服务引用实例在ASP.NET WEB应用程序中可用,但在MVC 4应用程序中不可用。

Please suggest solution. 请提出解决方案。

Please guide. 请指导。

Thank You 谢谢

can you describe it in more detail? 您可以更详细地描述它吗? The service reference is shown in your solution explorer like in a normal asp.net classic application? 服务参考在您的解决方案资源管理器中显示,就像在普通的asp.net经典应用程序中一样? How do you generate the service client? 您如何生成服务客户端? Using Visual Studio via right-click > Add > Service Reference? 通过右键单击>添加>服务参考来使用Visual Studio?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM