我怎样才能在mvc3中调用wcf服务 [英] How can i call wcf service in mvc3

查看:71
本文介绍了我怎样才能在mvc3中调用wcf服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在mvc3中调用wcf服务以及在哪里可以添加引用

表示控制器或模型

还是我必须创建任何其他文件夹?

How can i call wcf service in mvc3 and where can i add reference
means controller or model
or do i have to create any other folder?

推荐答案

试试这个,,,, :)



在MVC3中调用Web服务 [ ^ ]
try this,,,,:)

Call web services In MVC3[^]


您可以从任一服务器和MV中使用MVC3应用程序中的wcf服务a href =http://www.codeproject.com/Articles/132809/Calling-WCF-Services-using-jQuery>客户端 [ ^ ]。但在大多数情况下,服务器端是更好的方法。您可以像在任何其他.net应用程序中一样在mvc3应用程序中引用wcf服务( http:// msdn。 microsoft.com/en-us/library/cc668183.aspx [ ^ ])。

问题应该放在哪里的答案取决于它提供的实际服务,以及它在模型,视图和控制器概念中的对齐位置。 br />
文件夹只是为了引导您进行简洁的代码结构化,仅此而已。
You can consume wcf service in an MVC3 application from either server and client side[^]. But server side is a better approach in most cases. You can reference a wcf service in an mvc3 application as in any other .net application (http://msdn.microsoft.com/en-us/library/cc668183.aspx[^]).
The answer to the question where you should put it, depends on the actual service it provides, and where it can be aligned in the model, view and controller concepts.
Folders are just there to guide your towards neat code structuring, nothing more.


这篇关于我怎样才能在mvc3中调用wcf服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆