我需要构建一个独立的Java项目,并将其与Moqui集成作为中间层。

huangapple go评论77阅读模式
英文:

I need to build separate java project and integrating with the moqui as intermediate

问题

我需要构建一个独立的Java项目,并将其集成到Moqui作为中间件。

我需要找出如何从外部项目调用Moqui服务。

英文:

I need to build separate java project and integrating with the moqui as intermediate

I need to discover how to call moqui services from outer project

答案1

得分: 1

在moqui上调用服务时,您可以使用远程过程调用。最佳方法是通过REST API通过HTTP调用它们。

在"/apps/tools/dashboard"上,您可以查看不同方法的Swagger API文档,位于"REST API: Swagger UI"部分。

在该部分尝试moqui工具的REST API时,可以找到一个示例。
GET - "/rest/s1/moqui/basic/enums"将返回一个包含枚举列表的JSON。

如果要使用自定义服务,您需要在自定义服务中声明一个属性,以允许远程访问,并可以向其发送HTTP请求。

一些额外信息可以在以下链接找到:
https://www.moqui.org/m/docs/framework/System+Interfaces/Web+Service

如果在使用REST API时遇到授权问题,可以在以下问题中找到解决方法:
https://stackoverflow.com/questions/37562327/moquiin-moqui-how-to-access-rest-without-sign-any-user

英文:

For calling services on moqui you can use remote procedures. your best bet is to call them through http with a rest api.

At "/apps/tools/dashboard" you can see the swagger apoi docs of different methods under the "REST API: Swagger UI" section

An example can be found when trying the moqui tools rest api at that section.
GET - "/rest/s1/moqui/basic/enums" will return a json with a list of the enums.

If you want to use a custom service, You need to declare an attribute in your custom services to allow remote access and can send http requests to it.

Some extra information can be found at:
https://www.moqui.org/m/docs/framework/System+Interfaces/Web+Service

If you run into authorization problems with the rest api, that's solved in this question:
https://stackoverflow.com/questions/37562327/moquiin-moqui-how-to-access-rest-without-sign-any-user

huangapple
  • 本文由 发表于 2020年8月5日 16:08:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/63260924.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定