1

我使用 Grails 制作了 OCR 服务,一切运行良好。我想为它制作一个 Web 服务。RESTfull WS的输入应该是mime格式(客户端会发送一些XML格式的图片和相关信息到这个WS)。我如何在 Grails 中实现这一点?任何示例代码来指导我?

谢谢,

礼萨

4

1 回答 1

1

These days, most people do by writing one or more controllers that accept and return text/json (or text/xml if you really want).

Grails has great libraries on board for parsing these requests, all of which are part of the Groovy language:

I have used the approach above successfully on a project. You will end up with Controllers that are easy to unit test, which is a huge productivity win.

于 2012-11-26T16:51:52.343 回答