Skip to content

Commit

Permalink
Fix generating use case examples
Browse files Browse the repository at this point in the history
Fixes bet365#47

- update to latest `erlsom` with fix for 2x-nested translation of record
  list fields
  - fix crash when generating WSDL from `store.hrl`
  - regenerate doc/test clients/servers/headers based on new `erlsom`
    - amend tests based on regen'd files
- start/stop `ssl` app per suite to make a lot of tests pass
  • Loading branch information
danielfinke committed Jul 18, 2024
1 parent 856b5c4 commit 0c8e59c
Show file tree
Hide file tree
Showing 15 changed files with 684 additions and 647 deletions.
21 changes: 12 additions & 9 deletions doc/example.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

%% generated by soap from: e:/e_soap/soap/doc/example.wsdl
%% for service "contacts_service" and port "contacts_port"
%% using options: [{service,"contacts_service"},{port,"contacts_port"},{generate,both},{namespaces,[{"http://example.com/contacts.xsd",undefined}]},{http_server,soap_server_cowboy_1},{server_name,"example_server"},{http_client,soap_client_ibrowse},{client_name,"example_client"},{strict,true}]
%% using options: [{service,"contacts_service"},{port,"contacts_port"},{generate,both},{namespaces,[{"http://example.com/contacts.xsd",undefined}]},{generate_tests,none},{http_server,soap_server_cowboy_1},{server_name,"example_server"},{http_client,soap_client_ibrowse},{client_name,"example_client"},{strict,true}]

%%% This file contains record and type decarations that are used by the WSDL.
%%%
Expand Down Expand Up @@ -43,11 +43,14 @@
role :: string(),
detail :: [#faultdetail{}]}).

-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.



Expand Down Expand Up @@ -79,14 +82,14 @@
-type contact() :: #contact{}.
-define(INTERFACE, {interface,"contacts_service",example,'1.1',
soap_client_ibrowse,soap_server_cowboy_1,example_server,
example_client,[],
"http://schemas.xmlsoap.org/soap/envelope/",undefined,
"http://localhost:8080","contacts_port",
example_client,[],"http://example.com/contacts.wsdl",
"http://schemas.xmlsoap.org/soap/envelope/","document",
undefined,"http://localhost:8080","contacts_port",
"contacts_binding","contacts_port_type",
[{op,"store",store,"store",request_response,contact,id,
undefined},
{op,"retrieve",retrieve,"retrieve",request_response,id,
contact,undefined}],
[{op,"store",store,"store",undefined,request_response,
contact,id,undefined},
{op,"retrieve",retrieve,"retrieve",undefined,
request_response,id,contact,undefined}],
{model,
[{type,'_document',sequence,
[{el,
Expand Down Expand Up @@ -146,5 +149,5 @@
unqualified},
{ns,"http://www.w3.org/2001/XMLSchema","xsd",qualified}],
"http://example.com/contacts.xsd",[],false,skip},
1,
1,undefined,
[{"http://example.com/contacts.xsd",undefined}]}).
4 changes: 2 additions & 2 deletions doc/example_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

%% generated by soap from: e:/e_soap/soap/doc/example.wsdl
%% for service "contacts_service" and port "contacts_port"
%% using options: [{service,"contacts_service"},{port,"contacts_port"},{generate,both},{namespaces,[{"http://example.com/contacts.xsd",undefined}]},{http_server,soap_server_cowboy_1},{server_name,"example_server"},{http_client,soap_client_ibrowse},{client_name,"example_client"},{strict,true}]
%% using options: [{service,"contacts_service"},{port,"contacts_port"},{generate,both},{namespaces,[{"http://example.com/contacts.xsd",undefined}]},{generate_tests,none},{http_server,soap_server_cowboy_1},{server_name,"example_server"},{http_client,soap_client_ibrowse},{client_name,"example_client"},{strict,true}]

-module(example_client).

Expand Down Expand Up @@ -59,4 +59,4 @@ header_parser("test") ->
%%% Internal functions
%%% --------------------------------------------------------------------
interface() ->
?INTERFACE.
?INTERFACE.
2 changes: 1 addition & 1 deletion doc/example_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

%% generated by soap from: e:/e_soap/soap/doc/example.wsdl
%% for service "contacts_service" and port "contacts_port"
%% using options: [{service,"contacts_service"},{port,"contacts_port"},{generate,both},{namespaces,[{"http://example.com/contacts.xsd",undefined}]},{http_server,soap_server_cowboy_1},{server_name,"example_server"},{http_client,soap_client_ibrowse},{client_name,"example_client"},{strict,true}]
%% using options: [{service,"contacts_service"},{port,"contacts_port"},{generate,both},{namespaces,[{"http://example.com/contacts.xsd",undefined}]},{generate_tests,none},{http_server,soap_server_cowboy_1},{server_name,"example_server"},{http_client,soap_client_ibrowse},{client_name,"example_client"},{strict,true}]

-module(example_server).

Expand Down
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{erl_opts, [debug_info]}.

{deps, [
{erlsom, ".*", {git, "https://github.com/willemdj/erlsom.git", {tag, "v1.4.0"}}}
{erlsom, ".*", {git, "https://github.com/willemdj/erlsom.git", {ref, "70cbbf7"}}}

]}.

{ct_extra_params, "-spec test/test_specs.spec"}.
7 changes: 5 additions & 2 deletions test/SendService.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

%% generated by soap from: e:/e_soap/soap/test/soap_SUITE_data/SendService.wsdl
%% for service "SendService" and port "SendServiceSoap"
%% using options: [{service,"SendService"},{port,"SendServiceSoap"},{generate,both},{namespaces,[{"com.esendex.ems.soapinterface",undefined}]},{generate_tests,none},{http_server,soap_server_cowboy_1},{server_name,"sendService_test_server"},{http_client,soap_client_ibrowse},{client_name,"sendService_test_client"},{strict,true}]
%% using options: [{service,"SendService"},{port,"SendServiceSoap"},{generate,server},{namespaces,[{"com.esendex.ems.soapinterface",undefined}]},{generate_tests,none},{http_server,soap_server_cowboy_1},{server_name,"sendService_test_server"},{strict,true}]

%%% This file contains record and type decarations that are used by the WSDL.
%%%
Expand Down Expand Up @@ -57,11 +57,14 @@
role :: string(),
detail :: [#faultdetail{}]}).

-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.



Expand Down Expand Up @@ -105,7 +108,7 @@
-type sendMessageMultipleRecipients() :: #sendMessageMultipleRecipients{}.
-define(INTERFACE, {interface,"SendService",'SendService','1.1',
soap_client_ibrowse,soap_server_cowboy_1,
sendService_test_server,sendService_test_client,[],
sendService_test_server,undefined,[],
"com.esendex.ems.soapinterface",
"http://schemas.xmlsoap.org/soap/envelope/",undefined,
undefined,"http://localhost:8080/soap/SendService",
Expand Down
Loading

0 comments on commit 0c8e59c

Please sign in to comment.