Giter Club home page Giter Club logo

durden's Introduction

Durden - a tool to make SOAP with Erlang and Cowboy web-server.

Docs

Current status

Durden can generate a not too bad WSDL from specially cooked erlang modules. It also can handle SOAP/1.2-bound requests.

Nearest future

Soap transports:

  • HTTP-POST
  • SOAP/1.1
  • HTTP-GET

Support of indirect reference loops in the types declarations (currently parse transformation hangs when analysing a types like "A references B references A again")

Human readable documentation page (alike to that one generated when you visit .Net's ASMX page with no parameters)

How it wokrs

Durden analyses the source of the module supposed to become a Web-service via parse-transform.

The specs of the functions enlisted in 'soap_actions' attribute are analysed.

All the mentioned types are gathered recursively.

The type info is then used as the return value of a generated function Module:'#durden.get_wsd#'/0.

Besides the latter, 'cowboy_http_handler' behaviour is implemented: init/3 callback just asks Cowboy to upgrade the protocol into 'durden_cowboy_http_soap'.

Example

(https://github.com/RGafiyatullin/durden_examples)

The following module:

-module(soap_test_service).
-compile({parse_transform, durden_pt}).

-include_lib("durden/include/predefined_types.hrl").

-soap_target_ns("http://rgafiyatullin.github.com/test-service").
-soap_service_name("TestService").

-soap_actions(['GetUserByID'/1]).

-type phone_numbers() :: [ string() ].

-record('User', {
	'ID' :: uuid(),
	'Name' :: string(),
	'YearOfBirth' :: integer(),
	'Phones' :: phone_numbers()
	}).

-spec 'GetUserByID'( ID :: uuid() ) -> #'User'{}.
'GetUserByID'( ID ) ->
	#'User'{
		'ID' = ID,
		'Name' = "Test User",
		'YearOfBirth' = 1988,
		'Phones' = ["+375005550000", "+375115550000"]
	}.

produces WSDL below: (alternatively can be viewed at https://gist.github.com/3364435)


durden's People

Contributors

rgafiyatullin avatar joaohf avatar

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.