【问题标题】:REST kit for .Net?.Net 的 REST 工具包?
【发布时间】:2009-08-29 04:40:28
【问题描述】:

我刚开始使用 .Net C# 探索 RESTful 服务。在 CodePlex,有可用的 WCF REST Startkit。我观看了 Pluralsight 的几个 Screen-casts。演示非常酷,但它们基于 Startkit Preview 1。

我下载了最新版本的 Preview 2。好像 Service.basic.svc.cs 等一些类不可用。 Service.basic.svc.cs 提供开放代码,以便您可以更改其实现、端点模板、帮助描述等。这个缺失的部分让我很难定制我的模板、实现和帮助描述。也许新的 Preview 2 具有不同的结构或实现相同结果的替代方法。但是,我找不到任何关于这些的更多信息。

无论如何,WCF REST Startkit 仍然是预览版。不确定最终版本何时可用,也不确定它是否会免费开放。

有没有人体验过 Preview 2 并知道这些变化和替代方案?或者是否有其他用于 .Net 或 ASP.NET 的 REST 库(基于开源)?

【问题讨论】:

    标签: c# wcf rest


    【解决方案1】:

    “或者是否有另一个用于 .Net 或 ASP.NET 的 REST 库(基于开源)?”

    OpenRasta

    【讨论】:

    • -1 只是发布一个链接,甚至没有说明为什么链接是相关的。
    • 没关系。人们倾向于提供答案。这是一个非常有趣的图书馆。它基于资源、处理程序和编解码器。看起来该库在资源方面提供了非常好的和干净的 REST get/post。但是,Atom/RSS 功能尚不可用。
    • 对不起,约翰。我想如果有人读了这个问题,我回答的问题的哪一部分就很明显了。
    • 哇,约翰,这是一个糟糕的投票理由。该链接非常不言自明。如果您甚至发布了答案,也许我会同意您的看法,但是没有答案,在此线程中添加了什么??
    • 在约翰发表评论后,我确实添加了引用。以前我只有链接。他的评论是对的,因为我一直很懒惰。至于投反对票,我宁愿人们在投反对票时过于激进,而不是相反。我不喜欢不敢批评的社区。​​span>
    【解决方案2】:

    预览版 2 对我来说效果很好。但是我听说过如果安装悄无声息地失败,那么您需要卸载并重新安装入门工具包。

    namespace MySimpleService {
        // TODO: Modify the service behavior settings (instancing, concurrency etc) based on the service's requirements. Use ConcurrencyMode.Multiple if your service implementation
        //       is thread-safe.
        // TODO: NOTE: Please set IncludeExceptionDetailInFaults to false in production environments.
        [ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)]
        [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
        public class Service : AtomPubServiceBase, IAtomPubService {
            // TODO: These variables are used by the sample implementation. Remove if needed
            #region variables used in sample implementation
            const string xxx= "xxxx";
            List<SyndicationItem> booksmarkEntries = new List<SyndicationItem>();
            Dictionary<string, byte[]> collection1MediaItems = new Dictionary<string, byte[]>();
            Dictionary<string, string> collection1ContentTypes = new Dictionary<string, string>();
            #endregion
    
            public Service() {
                AddEntry("Main", "http:
    

    【讨论】:

    • Service.svc 下是否有可用的 Service.basic.svc.cs 类?我想念这堂课。基本的 cs 文件包含您可以修改的 AtomPubServiceBase 和 IAtomPubService 的实际代码。
    猜你喜欢
    • 2011-11-11
    • 2015-04-18
    • 1970-01-01
    • 2013-04-05
    • 1970-01-01
    • 2012-03-20
    • 2011-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多