digitalmars.D.announce - XML RPC Client and Server - meet xmlrpc-d
- Pavel Kirienko (36/36) Sep 01 2013 Hi everyone,
- angel (2/2) Sep 01 2013 Did you look at std.serialization (currently in the review queue)
- Pavel Kirienko (5/8) Sep 02 2013 Yes I'm aware of std.serialization, but it does not seem to
- Flamaros (4/42) Sep 02 2013 We'll need RPC for our projects, we are interested.
- ilya-stromberg (3/5) Sep 02 2013 +1
- Pavel Kirienko (12/18) Sep 02 2013 Thanks!
- ilya-stromberg (4/8) Sep 02 2013 As I know, the Vibe.d is good:
- Pavel Kirienko (6/20) Sep 02 2013 I know vibe.d, but it does not seem to be going into phobos, does
- ilya-stromberg (4/6) Sep 02 2013 I don't know, you should contact Sönke Ludwig to find out it.
- Flamaros (3/27) Sep 02 2013 I don't think a real server is needed here. A simple listen on a
- Dmitry Olshansky (4/7) Sep 02 2013 Well I don't expect that to pass review :)
- Dicebot (8/9) Sep 02 2013 I should warn - it won't be easy and is likely to require lot of
- Pavel Kirienko (3/3) Sep 03 2013 Guys, I decided to stay away from phobos integration at least
- ilya-stromberg (4/7) Sep 03 2013 You can try to integrate in Phobos only xmlrpc-d client.
Hi everyone, I am working on some D-based project that needs to call and serve XML-RPC procedures with multiple output parameters. Quick lookaround revealed that: 1. There are no XML-RPC servers implemented in D, or wrapped in D; 2. There are some simple XML-RPC clients, but no one supports methods with multiple output parameters. So I decided to write ultimate XML-RPC library that could follow XML-RPC standard as close as ... well, as I could manage it. :) Grab your copy here: https://github.com/pavel-kirienko/xmlrpc-d D's compile-time introspection is utterly amazing, it enables such features as automatic conversion of a value which type is not known at compile-time to something predefined. This makes possible to define XML-RPC methods in the simplest way possible (as regular functions), all the boring job of turning the function parameters into XML-RPC types and vice versa is carried out by compiler with the help of the Variant type: ---------- real multiply(real a, real b) { return a * b; } xmlrpcServer.addMethod!multiply(); ---------- Which also makes possble such weird things like that: ---------- // multiply() expects two arguments of type 'real' and returns 'real', // but we call it with strings: string ret = client.call!("multiply", string)("6", "9"); ---------- Take a look into the 'example' directory on the Github page to see more examples. It is worth to mention that this is my first project in D - I was concurrently studying "The D Programming Language" by Andrei Alexandrescu (great book Andrei!), thus the code may need some review. Good luck with your projects, Pavel.
Sep 01 2013
Did you look at std.serialization (currently in the review queue) ? An RPC does need serialization.
Sep 01 2013
On Monday, 2 September 2013 at 05:53:22 UTC, angel wrote:Did you look at std.serialization (currently in the review queue) ? An RPC does need serialization.Yes I'm aware of std.serialization, but it does not seem to support XML-RPC data representation. So I decided to use std.xml, with plans to switch to std.xml2 when available.
Sep 02 2013
On Sunday, 1 September 2013 at 19:50:47 UTC, Pavel Kirienko wrote:Hi everyone, I am working on some D-based project that needs to call and serve XML-RPC procedures with multiple output parameters. Quick lookaround revealed that: 1. There are no XML-RPC servers implemented in D, or wrapped in D; 2. There are some simple XML-RPC clients, but no one supports methods with multiple output parameters. So I decided to write ultimate XML-RPC library that could follow XML-RPC standard as close as ... well, as I could manage it. :) Grab your copy here: https://github.com/pavel-kirienko/xmlrpc-d D's compile-time introspection is utterly amazing, it enables such features as automatic conversion of a value which type is not known at compile-time to something predefined. This makes possible to define XML-RPC methods in the simplest way possible (as regular functions), all the boring job of turning the function parameters into XML-RPC types and vice versa is carried out by compiler with the help of the Variant type: ---------- real multiply(real a, real b) { return a * b; } xmlrpcServer.addMethod!multiply(); ---------- Which also makes possble such weird things like that: ---------- // multiply() expects two arguments of type 'real' and returns 'real', // but we call it with strings: string ret = client.call!("multiply", string)("6", "9"); ---------- Take a look into the 'example' directory on the Github page to see more examples. It is worth to mention that this is my first project in D - I was concurrently studying "The D Programming Language" by Andrei Alexandrescu (great book Andrei!), thus the code may need some review. Good luck with your projects, Pavel.We'll need RPC for our projects, we are interested. I hope you'll made pull requests for an integration to phobos. Good luck.
Sep 02 2013
On Monday, 2 September 2013 at 10:31:15 UTC, Flamaros wrote:We'll need RPC for our projects, we are interested. I hope you'll made pull requests for an integration to phobos.+1 It's really useful project.
Sep 02 2013
On Monday, 2 September 2013 at 14:07:52 UTC, ilya-stromberg wrote:On Monday, 2 September 2013 at 10:31:15 UTC, Flamaros wrote:Thanks! To be honest, the HTTP server shipped with this library is not so hot, it is just a stub which purpose is to fill the lacking of the default HTTP server in phobos. https://github.com/pavel-kirienko/xmlrpc-d/blob/master/src/http_server_bob.d I think there is no place for this particular piece of code in phobos. So, the question is: shall I make a pull request for xmlrpc-d with no HTTP server included? Is there anyone who have a solid HTTP server which is good enough for the standard library? We could cooperate.We'll need RPC for our projects, we are interested. I hope you'll made pull requests for an integration to phobos.+1 It's really useful project.
Sep 02 2013
On Monday, 2 September 2013 at 15:12:24 UTC, Pavel Kirienko wrote:So, the question is: shall I make a pull request for xmlrpc-d with no HTTP server included? Is there anyone who have a solid HTTP server which is good enough for the standard library? We could cooperate.As I know, the Vibe.d is good: https://github.com/rejectedsoftware/vibe.d But I don't know if it will be useful for you.
Sep 02 2013
On Monday, 2 September 2013 at 15:37:16 UTC, ilya-stromberg wrote:On Monday, 2 September 2013 at 15:12:24 UTC, Pavel Kirienko wrote:I know vibe.d, but it does not seem to be going into phobos, does it?So, the question is: shall I make a pull request for xmlrpc-d with no HTTP server included? Is there anyone who have a solid HTTP server which is good enough for the standard library? We could cooperate.As I know, the Vibe.d is good: https://github.com/rejectedsoftware/vibe.d But I don't know if it will be useful for you.I should warn - it won't be easy and is likely to require lot of work from contributor. Recent trend in Phobos contribution is to require good integration with existing modules and approaches - you can have a look at `std.serialization` threads to see what Jacob is going to go through to get to voting.Yeah it is not so easy I know, and I'm not sure I can make time for that right now. However, if someone wants to volunteer I'd glad to help.
Sep 02 2013
On Monday, 2 September 2013 at 15:54:12 UTC, Pavel Kirienko wrote:I know vibe.d, but it does not seem to be going into phobos, does it?I don't know, you should contact Sönke Ludwig to find out it. As I can see, there are a lot of code that could be useful for Phobos.
Sep 02 2013
On Monday, 2 September 2013 at 15:54:12 UTC, Pavel Kirienko wrote:On Monday, 2 September 2013 at 15:37:16 UTC, ilya-stromberg wrote:I don't think a real server is needed here. A simple listen on a port is sufficient.On Monday, 2 September 2013 at 15:12:24 UTC, Pavel Kirienko wrote:I know vibe.d, but it does not seem to be going into phobos, does it?So, the question is: shall I make a pull request for xmlrpc-d with no HTTP server included? Is there anyone who have a solid HTTP server which is good enough for the standard library? We could cooperate.As I know, the Vibe.d is good: https://github.com/rejectedsoftware/vibe.d But I don't know if it will be useful for you.I should warn - it won't be easy and is likely to require lot of work from contributor. Recent trend in Phobos contribution is to require good integration with existing modules and approaches - you can have a look at `std.serialization` threads to see what Jacob is going to go through to get to voting.Yeah it is not so easy I know, and I'm not sure I can make time for that right now. However, if someone wants to volunteer I'd glad to help.
Sep 02 2013
02-Sep-2013 20:41, Flamaros пишет:On Monday, 2 September 2013 at 15:54:12 UTC, Pavel Kirienko wrote:I don't think a real server is needed here. A simple listen on a port is sufficient.Well I don't expect that to pass review :) -- Dmitry Olshansky
Sep 02 2013
On Monday, 2 September 2013 at 10:31:15 UTC, Flamaros wrote:I hope you'll made pull requests for an integration to phobos.I should warn - it won't be easy and is likely to require lot of work from contributor. Recent trend in Phobos contribution is to require good integration with existing modules and approaches - you can have a look at `std.serialization` threads to see what Jacob is going to go through to get to voting. One may argue if it is too demanding but I personally like high quality and consistency levels defined by standard library.
Sep 02 2013
Guys, I decided to stay away from phobos integration at least until it has some HTTP server out of the box. Anyway this decision does not make xmlrpc-d less usable. :)
Sep 03 2013
On Tuesday, 3 September 2013 at 10:28:56 UTC, Pavel Kirienko wrote:Guys, I decided to stay away from phobos integration at least until it has some HTTP server out of the box. Anyway this decision does not make xmlrpc-d less usable. :)You can try to integrate in Phobos only xmlrpc-d client. It can be useful for integration whith 3rd-party XML RPC servises.
Sep 03 2013