Re: XML RPC Client and Server - meet xmlrpc-d

2013-09-03 Thread Pavel Kirienko
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. :)


Re: XML RPC Client and Server - meet xmlrpc-d

2013-09-02 Thread Pavel Kirienko

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.


Re: XML RPC Client and Server - meet xmlrpc-d

2013-09-02 Thread Pavel Kirienko

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:
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 know vibe.d, but it does not seem to be going into phobos, does 
it?



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.


XML RPC Client and Server - meet xmlrpc-d

2013-09-01 Thread Pavel Kirienko

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.