想用WCF和MVC开发项目 [英] Want to develop project with WCF and MVC

查看:105
本文介绍了想用WCF和MVC开发项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们



我想开发一个基于WCF和Mvc4的大项目。我脑子里有一些问题。

1.)什么是最好的approch?这可能是导致缓慢的问题吗?

2.)如何防止未经授权的用户访问服务网址。

3.)我希望保持对服务URL的控制。

4.)如何检查用户是否有效访问服务网址?

5.)如何开始开发项目?



我请你们都请发一些项目或例子来启动我的项目。



提前付款



我尝试过:







没什么

Dear Friends

I want to develop an big project based on WCF and Mvc4. I have some question in my mind.
1.) What is the best approch?? It can be lead slowness issue?
2.) How to prevent unauthorized user to access Service url.
3.) I want keep control over Service Url.
4.) How can be check user is valid to access service url??
5.) How can i start to develop project??

I request you all please send some project or example to start my project.

Thanks in advance

What I have tried:



Nothing

推荐答案

引用:

我请你们都请发送一些项目或示例来启动我的项目。

I request you all please send some project or example to start my project.



如果您只是想要代码,搜索互联网或聘请专业程序员。



如果你想学习编程,那就继续学习。

建议:

- 暂时忘掉这个项目。

- 学习认真对待公关的技巧ogramming

- 练习很多。

- 当你放松时,回到你的项目。


If you just want code, search internet or hire a professional programmer.

If you want to learn programming, then go on and learn.
Advice:
- Forget about this project for now.
- Learn seriously the techniques for programming
- Practice a lot.
- When you are at ease, go back to your project.


因为其他人说过你需要听到的:学习编程。我会继续并概述您需要学习什么才能开始这个或类似的项目。好的,请在以下列表中找到答案:

Since others have said what you need to hear: Learn programming. I would continue and give you an overview of what you need to learn in order to get started on this or a similar project. Ok, have your answers in the following list:
Quote:

什么是最好的approch?它可能是导致慢速问题?

What is the best approch?? It can be lead slowness issue?

删除Web服务。而不是这样,使用ASP.NET Web API。我个人曾多次表示,与Web服务相比,ASP.NET Web API是一种更好的方法。首先,可以使用HTTP协议从任何平台使用Web API - 几乎每个框架都支持网络和HTTP通信。 Web Service确实提供了多种解决方案,如SOAP,但现在不再使用了。也使用JSON而不是XML。

Drop Web Services. Instead of this, use ASP.NET Web API. I have personally stated on multiple occasions, that ASP.NET Web API is a much better approach as compared to Web Services. First of them being, Web API can be consumed from any platform using HTTP protocol — almost every framework supports networking and HTTP communication. Web Service does provide multiple solutions, like SOAP, but that isn't used anymore nowadays. Use JSON instead of XML too.

引用:

如何防止未经授权的用户访问服务网址。

How to prevent unauthorized user to access Service url.

再一次,ASP .NET Web API胜过Web服务。您只需要向实际端点(控制器)添加一个属性,框架本身就会为您处理身份验证。

One more time, where ASP.NET Web API beats Web Services. You just need to add one attribute to the actual endpoint (controller), and framework itself will handle the authentication for you.

[Authorize]
public class ServiceController : ApiController {
   // Your actions  and HTTP handlers here.
}



在WCF中也可以进行身份​​验证,但这并不容易。


Authentication is possible in WCF too, but that is not as easy.

Quote:

我想控制服务网址。

你是网络管理员吗?如果是这样,你已经拥有了。我开始怀疑这一点 - 每个程序员都可以控制他们的服务,除非他们编写的框架很差。

Are you the web admin? If so, you already have that. I am starting to doubt this a bit — every programmer has the control over their service, unless they write the frameworks poorly.

引用:

如何检查用户是否有效访问服务网址?

How can be check user is valid to access service url??

查看答案到你的第二个问题。此外,用户配置文件可以保存有关其订阅的信息(如果这是您正在寻找的)。然后你可以允许他们访问,或者根据你自己的逻辑拒绝他们访问。

See the answer to your second question. Also, the user profile can hold the information about their subscription (if that is what you are looking for). Then you can allow them access, or deny them access based on your own logic.

引用:

我怎么能开始开发项目??

How can i start to develop project??

下载 Visual Studio 2015社区 [ ^ ]。祝你好运。



欲了解更多信息,请阅读以下内容,

AuthorizeAttribute Class (System.Web.Mvc) [ ^ ]

Download Visual Studio 2015 Community[^]. Good luck.

For more please read the following,
AuthorizeAttribute Class (System.Web.Mvc)[^]


这篇关于想用WCF和MVC开发项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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