Durden can generate a not too bad WSDL from specially cooked erlang modules. It also can handle SOAP/1.2-bound requests.
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)
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'.
(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)