使用 OpenRasta 服务
根据此处的建议,我正在考虑是否用 OpenRasta 替换 WCF。
在 Visual Studio 中,如何以与 WCF/ASMX 服务相同的方式使用 OpenRasta,例如添加服务引用,这使用 WSDL 处理类型。
我找不到任何不需要自定义 WebRequest 并解析 xml 的示例,这对我们来说是在代码中利用服务的重大倒退。
Following advice on here, I am looking at whether to replace WCF with OpenRasta.
In Visual Studio, how do I consume an OpenRasta in the same way as I would a WCF/ASMX service e.g. Add a service reference, this handles the types using WSDL.
I can't find any examples which don't require a custom WebRequest and parse the xml, which for us is a significant step backwards for utilising a service in code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
OpenRasta 旨在为您提供 RESTful 服务。要使用它,您可能需要查看类似 RestSharp 的内容,它旨在充当 RESTful 服务的客户端/消费者。
OpenRasta is designed to give you RESTful services. To consume that, you might want to look at something like RestSharp which is designed to act as a client/consumer for RESTful services.
正如 Colin 所说,ReSTful 服务根据定义是面向超媒体的,因此按照 WSDL 生成大量 RPC 风格的代码是不可行的,这会破坏超媒体。
您仍然可以愉快地从 xsd 生成数据契约样式的类并从 xml 读取这些类,最多 4 行代码。
As Colin says, ReSTful services are by definition hypermedia oriented, so generating lots and lots of RPC style code a la WSDL is not doable, it would break hypermedia.
You can still happily generate datacontract-style classes from an xsd and read those from the xml, it's at most 4 lines of code.