如何从 WADL 文件生成 C# 代码?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1126448/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I generate C# code from WADL files?
提问by Anders Sandvig
I am looking for a code generator than can generate C# code to access RESTful web services described by WADL filesin a way similar to how wadl2javaworks.
我正在寻找一个代码生成器,它可以生成 C# 代码,以类似于wadl2java 的工作方式访问WADL 文件描述的 RESTful Web 服务。
Doing som searching I came across the rest-api-code-genproject on Google Code, but although the latest source does in fact support C#, the REST Describe & Compile demo sitedoes not. (The C# button is there, but it's disabled.)
在进行一些搜索时,我在 Google Code 上发现了rest-api-code-gen项目,但尽管最新源实际上支持 C#,但REST Describe & Compile 演示站点不支持。(C# 按钮在那里,但它已被禁用。)
I realize I could download the source and set up my own server with the latest version, but I would prefer not to, as what I need is a command line tool and not a web application with dependencies to Google Web Toolkit. I guess I could write my own a command line tool based on the same source code, but if it has already been done, or other tools can do the job, I'd rather avoid it.
我意识到我可以下载源代码并使用最新版本设置我自己的服务器,但我不想这样做,因为我需要的是命令行工具,而不是依赖于 Google Web Toolkit 的 Web 应用程序。我想我可以基于相同的源代码编写自己的命令行工具,但如果已经完成,或者其他工具可以完成这项工作,我宁愿避免它。
So, I'm wondering, are there any tools like that out there?
所以,我想知道,那里有类似的工具吗?
回答by Nathan Feger
Another possible answer: http://code.google.com/p/rest-api-code-gen/
另一个可能的答案:http: //code.google.com/p/rest-api-code-gen/
回答by Regfor
There is no normal tool for C# and WADL. rest-api-code-gen project seems to be not developing anymore. And may be in future nothing will be changed. There is no definitive opinion about need of WADL for REST and it's non standard like a WSDL
没有用于 C# 和 WADL 的普通工具。rest-api-code-gen 项目似乎不再开发了。并且可能在未来什么都不会改变。对于 REST 是否需要 WADL 没有明确的意见,它与 WSDL 一样是非标准的