Skip to content

Commit aed2ea8

Browse files
authored
Secured WSDL example with YAML (#2550)
* feat: add secured WSDL example with YAML config, update documentation and test alignment - Introduced `apis.yaml` for secured WSDL configurations. - Revised `ROADMAP.md` with a question about deprecating the old `rest2soap` interceptor. - Updated `README.md` with instructions for secured WSDL usage. - Adjusted test endpoint for SOAP proxy in `SecuredWsdlExampleTest`. * refactor: minor
1 parent 4a3d84f commit aed2ea8

4 files changed

Lines changed: 51 additions & 8 deletions

File tree

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# Securing a WSDL
1+
# Using a secured WSDL for a SOAP Proxy
22

3-
## How it works
4-
- The `soapProxy` acts as an entry point, listening on port `2010` and forwarding WSDL requests to the internal `wsdl-proxy`.
5-
- The `wsdl-proxy` provides full authentication configuration.
6-
- To secure a WSDL service, replace `<sampleSoapService/>` with a <target> definition specifying the actual WSDL endpoint. Authentication settings should be configured within the `wsdl-proxy` to ensure proper access control.
3+
Usually WSDL documents are not secured and can be freely accessed by anyone. But sometimes WSDL documentation is considered sensitive and is protected by access control.
74

8-
**Refer to [`proxies.xml`](./proxies.xml) for further details, settings, and modifications.**
5+
To reference a secured WSDL in Membrane, configure an internal API to handle authentication and authorization with the server hosting the WSDL.
6+
7+
See the `apis.yaml` for a starting point.
98

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# yaml-language-server: $schema=https://www.membrane-api.io/v7.0.5.json
2+
#
3+
# 1.) Start Membrane:
4+
# ./membrane.sh
5+
#
6+
# 2.) Open the WSDL in a browser:
7+
# The WSDL from the wsdl-API: http://localhost:2001/?wsdl
8+
# The WSDL from the SOAP Proxy: http://localhost:2000/?wsdl
9+
# The Service publisher: http://localhost:2000
10+
#
11+
# 3.) Change the API below to retrieve the WSDL
12+
13+
# Internal API
14+
api:
15+
name: wsdl
16+
port: 2001 # For debugging purposes. Cause it is used with internal:// no port is needed
17+
flow:
18+
# Remove that service an configure in this API SSL, HTTP headers or other means of authentication
19+
- sampleSoapService: {}
20+
# target:
21+
# ssl:
22+
# keystore:
23+
# location: keystore.p12
24+
# password: changeit
25+
26+
---
27+
soapProxy:
28+
port: 2000
29+
# Reference the internal API
30+
wsdl: internal://wsdl/?wsdl

distribution/src/test/java/com/predic8/membrane/examples/withoutinternet/test/SecuredWsdlExampleTest.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,24 @@ public String getExampleDirName() {
2828
}
2929

3030
@Test
31-
void testSecuredWsdl() {
31+
void wsdlFromInternalAPI() {
3232
// @formatter:off
3333
given()
3434
.when()
35-
.get("http://localhost:2010/services?wsdl")
35+
.get("http://localhost:2001/?wsdl")
36+
.then()
37+
.statusCode(200)
38+
.contentType(XML)
39+
.body(containsString("wsdl:definitions"));
40+
// @formatter:on
41+
}
42+
43+
@Test
44+
void wsdlFromSOAPProxy() {
45+
// @formatter:off
46+
given()
47+
.when()
48+
.get("http://localhost:2000/?wsdl")
3649
.then()
3750
.statusCode(200)
3851
.contentType(XML)

docs/ROADMAP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
# 7.X
1616

17+
- Question: Should we remove the old rest2soap interceptor(using XSLT) in favor of the new template based examples?
1718
- Do we need add(Rule,Source) and getRuleBySource(Manual|Spring)?
1819
- Rewrite ACL to use the YAML configuration instead of external XML files
1920
- Fix maven central publish job

0 commit comments

Comments
 (0)