WCF Restful Web Service返回JSON

时间:2022-12-29 19:36:02

I have been reading up on WCF and was looking for a good tutorial on creating a WCF Restful service that returns Json. I cant seem to find any that are really worth reading, does any have any ones they would recommend for someone who just wants to start with the basics and learn about WCF Restful service? I am unsure if I should start with WCF 3.5 or WCF 4 too. I am using Visual Studio 2010, so I could potentially do either one or both.

我一直在阅读WCF,并正在寻找一个关于创建返回Json的WCF Restful服务的好教程。我似乎无法找到任何真正值得阅读的内容,是否有任何人会推荐给那些只想从基础开始并了解WCF Restful服务的人?我不确定我是否应该从WCF 3.5或WCF 4开始。我正在使用Visual Studio 2010,所以我可能会做一个或两个。

4 个解决方案

#1


3  

WCF4 already has nice built-in templates for JSON, whereas in WCF 3.5 it's a bit fiddly and you need to manually add support for that.

WCF4已经为JSON提供了很好的内置模板,而在WCF 3.5中它有点繁琐,你需要手动添加对它的支持。

check this out for some docs

检查一下这些文档

Hope this helps

希望这可以帮助

#2


1  

I honestly used the MSDN and thought it was very thourough. Its what I used to get up to snuff and build my WCF Rest Service but I am assuming you already looked there. This was my favorite link that I to this day, still have bookmarked.

我老实说使用了MSDN,并认为它非常糟糕。它是我曾经起来制作我的WCF休息服务,但我假设你已经看过那里了。这是我最喜欢的链接,直到今天,仍然有书签。

Pertaining to your 4.0 vs 3.5. I almost always defer to later technology if you can, especially WCF simply because Microsoft has made things a little easier with things such as what Leon stated.

与你的4.0 vs 3.5有关。如果可以的话,我几乎总是会遵循以后的技术,尤其是因为微软通过诸如莱昂所说的事情使事情变得更容易。

#3


1  

there are these videos for beginners and certainly very helpful.

这些视频适合初学者,当然非常有帮助。

you can learn about how to create services within minutes.

您可以在几分钟内了解如何创建服务。

http://msdn.microsoft.com/en-us/netframework/dd939784

There is a video to show how to configure a rest json service as well.

有一个视频,展示如何配置休息json服务。

#4


0  

I have been reading up on WCF and was looking for a good tutorial on creating a WCF Restful service that returns Json. I cant seem to find any that are really worth reading, does any have any ones they would recommend for someone who just wants to start with the basics and learn about WCF Restful service?

我一直在阅读WCF,并正在寻找一个关于创建返回Json的WCF Restful服务的好教程。我似乎无法找到任何真正值得阅读的内容,是否有任何人会推荐给那些只想从基础开始并了解WCF Restful服务的人?

I had exactly the same problem last year.

去年我遇到了同样的问题。

Eventually, I worked out the steps you have to follow to create a JSON WCF Web Service - it is straightforward if you get each of the steps right, but finding an easy-to-follow walkthrough was tough.

最后,我制定了您必须遵循的步骤来创建JSON WCF Web服务 - 如果您正确地完成每个步骤,那么这很简单,但是找到一个易于理解的演练很难。

Here's the walkthrough I created, clearly documenting what you need to do:

这是我创建的演练,清楚地记录了您需要做的事情:

http://mikesknowledgebase.com/pages/Services/WebServices-Page1.htm

I follow this walkthrough whenever I create services, both for my ASP.Net apps or iOS apps.

每当我为ASP.Net应用程序或iOS应用程序创建服务时,我都会按照此演练进行操作。

WCF Restful Web Service返回JSON

Good luck !

祝好运 !

#1


3  

WCF4 already has nice built-in templates for JSON, whereas in WCF 3.5 it's a bit fiddly and you need to manually add support for that.

WCF4已经为JSON提供了很好的内置模板,而在WCF 3.5中它有点繁琐,你需要手动添加对它的支持。

check this out for some docs

检查一下这些文档

Hope this helps

希望这可以帮助

#2


1  

I honestly used the MSDN and thought it was very thourough. Its what I used to get up to snuff and build my WCF Rest Service but I am assuming you already looked there. This was my favorite link that I to this day, still have bookmarked.

我老实说使用了MSDN,并认为它非常糟糕。它是我曾经起来制作我的WCF休息服务,但我假设你已经看过那里了。这是我最喜欢的链接,直到今天,仍然有书签。

Pertaining to your 4.0 vs 3.5. I almost always defer to later technology if you can, especially WCF simply because Microsoft has made things a little easier with things such as what Leon stated.

与你的4.0 vs 3.5有关。如果可以的话,我几乎总是会遵循以后的技术,尤其是因为微软通过诸如莱昂所说的事情使事情变得更容易。

#3


1  

there are these videos for beginners and certainly very helpful.

这些视频适合初学者,当然非常有帮助。

you can learn about how to create services within minutes.

您可以在几分钟内了解如何创建服务。

http://msdn.microsoft.com/en-us/netframework/dd939784

There is a video to show how to configure a rest json service as well.

有一个视频,展示如何配置休息json服务。

#4


0  

I have been reading up on WCF and was looking for a good tutorial on creating a WCF Restful service that returns Json. I cant seem to find any that are really worth reading, does any have any ones they would recommend for someone who just wants to start with the basics and learn about WCF Restful service?

我一直在阅读WCF,并正在寻找一个关于创建返回Json的WCF Restful服务的好教程。我似乎无法找到任何真正值得阅读的内容,是否有任何人会推荐给那些只想从基础开始并了解WCF Restful服务的人?

I had exactly the same problem last year.

去年我遇到了同样的问题。

Eventually, I worked out the steps you have to follow to create a JSON WCF Web Service - it is straightforward if you get each of the steps right, but finding an easy-to-follow walkthrough was tough.

最后,我制定了您必须遵循的步骤来创建JSON WCF Web服务 - 如果您正确地完成每个步骤,那么这很简单,但是找到一个易于理解的演练很难。

Here's the walkthrough I created, clearly documenting what you need to do:

这是我创建的演练,清楚地记录了您需要做的事情:

http://mikesknowledgebase.com/pages/Services/WebServices-Page1.htm

I follow this walkthrough whenever I create services, both for my ASP.Net apps or iOS apps.

每当我为ASP.Net应用程序或iOS应用程序创建服务时,我都会按照此演练进行操作。

WCF Restful Web Service返回JSON

Good luck !

祝好运 !