Giter Site home page Giter Site logo

xmlrpcc-d's Introduction

XML-RPC client for D Programming Language

Based on Pavel Kirienko library.

Basic usage

import xmlrpcc.client;

auto client = new Client("http://phpxmlrpcc.sourceforge.net/server.php");

double resp1 = client.call!("examples.addtwodouble", double)(534.78, 168.36);
assert(approxEqual(resp1, 703.14));

string resp2 = client.call!("examples.stringecho", string)("Hello Galaxy!");
assert(resp2 == "Hello Galaxy!");

real resp2_1 = client.call!("examples.stringecho", real)("123.456"); // IMPLICIT CONVERSION
assert(approxEqual(resp2_1, 123.456));

int[string] resp3 = client.call!("validator1.countTheEntities", int[string])("A < C ' > 45\" 12 &");
assert(1 == resp3["ctQuotes"]);
assert(1 == resp3["ctLeftAngleBrackets"]);
assert(1 == resp3["ctRightAngleBrackets"]);
assert(1 == resp3["ctAmpersands"]);
assert(1 == resp3["ctApostrophes"]);

int[string][] arrayOfStructs = [["moe" : 1, "larry" : 2, "curly" : 3], ["moe" : -98, "larry" : 23, "curly" : -6]];
int resp4 = client.call!("validator1.arrayOfStructsTest", int)(arrayOfStructs);
assert(resp4 == -3);

Test

Unit test uses Online demo server.

$ dub test

Compiling

You can use dub:

$ dub build

Or (on linux) makefile:

$ make release

Requirements

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.