How do I do RPC in Perl with Catalyst?

I am trying to find a good RPC form for standardization, but so far I have come across tons of walls and wondered what the stackoverflow community view is.

My ideal RPC will provide the following:

  • Somewhat broad support in other languages, because people do not need to write their own stack to use our server.
  • Input check
  • Ideally, some way to turn the above input check into some kind of automatic documentation for distribution
  • Clean and maintained code

I am a fan of the catalytic structure and would prefer to stick to it, but if there is a clear alternative for RPC servers, I will be open too.

So far I have considered the following:

Catalyst :: Controller :: SOAP It does not seem to support the return of complex data structures, but only a string ("literals"). I could probably serialize the data on top of this, but it seems very hacked. It also allows you to return a preformed XML object, but I couldnโ€™t get it working, and it looks like you will need to re-create a lot of SOAP data structure for it to work.

I like the idea of โ€‹โ€‹WSDL, but the complexity of the general specification also makes me wonder how well it will communicate with other languages.

XML-based POSTing user controller We tried to manually collapse manually, similar to the way we saw two other projects recently, when there is a send URL to which you send XML. This allows you to check / document the XSD, but this requires a lot more code to be created than we want to save at this point.

Catalyst :: Plugin :: Server :: XMLRPC Caution about using an obsolete method that will be removed in a future version of Catalyst. There is no input validation or document creation, but otherwise the best I have found

JSONRPC Looks pretty similar to XMLRPC, only the module is actually being updated. I will probably do the following if someone doesnโ€™t offer something better. There are also two different catalyst modules that make JSONRPC.

+4
source share
2 answers

I understand that REST is not pure RPC (only a subset), but ...

I would recommend Catalyst :: Controller :: Rest and Catalyst :: Action :: REST . They are often updated and the documentation is pretty good. There is also a good (but rather outdated) example of using Catalyst :: Controller :: Rest in the 2006 Catalog Directory calendar called Day 9 - Web Services with Catalyst :: Action :: REST .

+4
source

FWIW, Catalyst :: Controller :: SOAP supports the return of complex data. Take a look at the documentation http://search.cpan.org/~druoso/Catalyst-Controller-SOAP-1.23/lib/Catalyst/Controller/SOAP.pm , which will show you that you can use WSDL to describe your service. In addition, see http://daniel.ruoso.com/categoria/perl/soap-today.html.en for a more detailed step-by-step process.

0
source

Source: https://habr.com/ru/post/1300662/


All Articles