@@ -28,14 +28,18 @@ Tested with: **Tomcat 11.0.20** · **OpenJDK 21** · **Spring Boot 3.4.3**
2828
2929## Services
3030
31- | Service | Path | Auth |
32- | ---------| ------| ------|
33- | ` LoginService.login ` | ` POST /axis2-json-api/services/LoginService ` | None (public) |
34- | ` TestwsService.testws ` | ` POST /axis2-json-api/services/TestwsService ` | Bearer token |
35- | ` BigDataH2Service.processBigDataSet ` | ` POST /axis2-json-api/services/BigDataH2Service ` | None (public) |
36- | OpenAPI spec (JSON) | ` GET /axis2-json-api/openapi.json ` | None |
37- | OpenAPI spec (YAML) | ` GET /axis2-json-api/openapi.yaml ` | None |
38- | Swagger UI | ` GET /axis2-json-api/swagger-ui ` | None |
31+ | Service | Operation | Path | Auth |
32+ | ---------| -----------| ------| ------|
33+ | ` loginService ` | ` doLogin ` | ` POST /axis2-json-api/services/loginService ` | None (public) |
34+ | ` testws ` | ` doTestws ` | ` POST /axis2-json-api/services/testws ` | Bearer token |
35+ | ` BigDataH2Service ` | ` processBigDataSet ` | ` POST /axis2-json-api/services/BigDataH2Service ` | Bearer token |
36+ | ` FinancialBenchmarkService ` | ` portfolioVariance ` | ` POST /axis2-json-api/services/FinancialBenchmarkService ` | Bearer token |
37+ | ` FinancialBenchmarkService ` | ` monteCarlo ` | ` POST /axis2-json-api/services/FinancialBenchmarkService ` | Bearer token |
38+ | ` FinancialBenchmarkService ` | ` scenarioAnalysis ` | ` POST /axis2-json-api/services/FinancialBenchmarkService ` | Bearer token |
39+ | OpenAPI spec (JSON) | — | ` GET /axis2-json-api/openapi.json ` | None |
40+ | OpenAPI spec (YAML) | — | ` GET /axis2-json-api/openapi.yaml ` | None |
41+ | Swagger UI | — | ` GET /axis2-json-api/swagger-ui ` | None |
42+ | OpenAPI MCP | — | ` GET /axis2-json-api/openapi-mcp.json ` | None |
3943
4044---
4145
@@ -86,47 +90,76 @@ curl http://localhost:8080/axis2-json-api/swagger-ui
8690### 2. Login (get Bearer token)
8791
8892``` bash
89- curl -s -X POST http://localhost:8080/axis2-json-api/services/LoginService \
93+ curl -s -X POST http://localhost:8080/axis2-json-api/services/loginService \
9094 -H ' Content-Type: application/json' \
91- -d ' {"login ":[{"request ":{"email":"user@example.com ","credentials":"password "}}]}'
95+ -d ' {"doLogin ":[{"arg0 ":{"email":"java-dev@axis.apache.org ","credentials":"userguide "}}]}'
9296```
9397
94- Response: ` {"loginResponse ":{"token":"<JWT >","status":"OK"}} `
98+ Response: ` {"response ":{"token":"<TOKEN>","uuid":"<UUID >","status":"OK"}} `
9599
96- ### 3. Call protected service
100+ ### 3. Call protected service (testws)
101+
102+ ` messagein ` must pass ESAPI ` SafeString ` validation (` [A-Za-z0-9.,\-_ ]* ` — no ` + ` or special
103+ characters).
97104
98105``` bash
99- TOKEN=" <JWT from step 2>"
100- curl -s -X POST http://localhost:8080/axis2-json-api/services/TestwsService \
106+ TOKEN=" <token from step 2>"
107+ curl -s -X POST http://localhost:8080/axis2-json-api/services/testws \
101108 -H ' Content-Type: application/json' \
102109 -H " Authorization: Bearer $TOKEN " \
103- -d ' {"testws ":[{"request ":{"name ":"World "}}]}'
110+ -d ' {"doTestws ":[{"arg0 ":{"messagein ":"hello world "}}]}'
104111```
105112
106- ### 4. Call public BigData service
113+ ### 4. Call BigData service
107114
108- Required fields: ` datasetId ` (non-empty string) and ` datasetSize ` ( bytes) . Size determines
109- processing path: <10MB → standard, 10–50MB → multiplexing, >50MB → streaming.
115+ ` datasetSize ` is in bytes. Size determines processing path: <10 MB → standard,
116+ 10–50 MB → multiplexing, >50 MB → streaming. Use at least 1 000 000 to get populated results .
110117
111118``` bash
112119curl -s -X POST http://localhost:8080/axis2-json-api/services/BigDataH2Service \
113120 -H ' Content-Type: application/json' \
114- -d ' {"processBigDataSet":[{"request":{"datasetId":"test-dataset-001","datasetSize":1048576}}]}'
121+ -H " Authorization: Bearer $TOKEN " \
122+ -d ' {"processBigDataSet":[{"arg0":{"datasetId":"test-001","datasetSize":1000000,"processingMode":"streaming","enableMemoryOptimization":true,"analyticsType":"summary"}}]}'
115123```
116124
117- Response includes ` processedRecordCount ` , ` http2Optimized ` , ` memoryOptimized ` , and (for <10MB
118- datasets) a ` processedRecords ` array.
125+ Response includes ` processedRecordCount ` , ` http2Optimized ` , ` memoryOptimized ` , and a
126+ ` processedRecords ` array.
127+
128+ ### 5. Financial Benchmark Service
129+
130+ ``` bash
131+ # Portfolio variance — O(n²) covariance matrix
132+ curl -s -X POST http://localhost:8080/axis2-json-api/services/FinancialBenchmarkService \
133+ -H ' Content-Type: application/json' \
134+ -H " Authorization: Bearer $TOKEN " \
135+ -d ' {"portfolioVariance":[{"arg0":{"nAssets":2,"weights":[0.6,0.4],"covarianceMatrix":[[0.04,0.006],[0.006,0.09]],"normalizeWeights":false,"nPeriodsPerYear":252}}]}'
136+
137+ # Monte Carlo VaR — GBM simulation
138+ curl -s -X POST http://localhost:8080/axis2-json-api/services/FinancialBenchmarkService \
139+ -H ' Content-Type: application/json' \
140+ -H " Authorization: Bearer $TOKEN " \
141+ -d ' {"monteCarlo":[{"arg0":{"nSimulations":10000,"nPeriods":252,"initialValue":100.0,"expectedReturn":0.08,"volatility":0.20,"nPeriodsPerYear":252,"randomSeed":42}}]}'
142+
143+ # Scenario analysis — probability-weighted expected return
144+ curl -s -X POST http://localhost:8080/axis2-json-api/services/FinancialBenchmarkService \
145+ -H ' Content-Type: application/json' \
146+ -H " Authorization: Bearer $TOKEN " \
147+ -d ' {"scenarioAnalysis":[{"arg0":{"assets":[{"assetId":1,"currentPrice":100.0,"positionSize":100,"scenarios":[{"price":120.0,"probability":0.3},{"price":100.0,"probability":0.5},{"price":75.0,"probability":0.2}]}],"useHashLookup":true,"probTolerance":0.001}}]}'
148+ ```
119149
120150---
121151
122152## Axis2 JSON-RPC request format
123153
124- The top-level key is the ** operation name** , and the body is wrapped in an array:
154+ The top-level key is the ** operation name** , and the value is an array containing one object
155+ whose key is the argument name (conventionally ` arg0 ` ) and whose value is the request POJO:
125156
126157``` json
127- { "operationName" : [{ "request " : { ...fields... } }] }
158+ { "operationName" : [{ "arg0 " : { ...fields... } }] }
128159```
129160
161+ This is mandated by ` JsonUtils.invokeServiceClass() ` in the ` axis2-json ` module.
162+
130163---
131164
132165## Architecture notes
@@ -135,7 +168,12 @@ The top-level key is the **operation name**, and the body is wrapped in an array
135168 ` SpringApplication.run() ` . Spring Boot only provides configuration; Tomcat is the server.
136169- ** No ` DispatcherServlet ` ** — ` @GetMapping ` annotations are dead code in this module. OpenAPI
137170 endpoints are served by ` OpenApiServlet ` , a plain ` HttpServlet ` registered directly in
138- ` Axis2WebAppInitializer ` at ` /openapi.json ` , ` /openapi.yaml ` , and ` /swagger-ui ` .
171+ ` Axis2WebAppInitializer ` at ` /openapi.json ` , ` /openapi.yaml ` , ` /swagger-ui ` , and
172+ ` /openapi-mcp.json ` .
173+ - ** Axis2 repository path** — ` Axis2WebAppInitializer ` explicitly sets the
174+ ` axis2.repository.path ` servlet init parameter using ` ServletContext.getRealPath("/WEB-INF") ` .
175+ This is required on both Tomcat and WildFly to ensure ` WarBasedAxisConfigurator ` finds the
176+ ` WEB-INF/services/*.aar ` archives reliably, bypassing any VFS or lazy-init timing issues.
139177- ** OpenAPI module** — ` axis2-openapi-<version>.jar ` is copied to
140178 ` WEB-INF/modules/openapi-<version>.mar ` by the Maven build. It must be present for
141179 ` GET /openapi.* ` and ` GET /swagger-ui ` to work.
@@ -144,14 +182,15 @@ The top-level key is the **operation name**, and the body is wrapped in an array
144182
145183---
146184
147- ## Relationship to ` springbootdemo ` (WildFly)
185+ ## Relationship to ` springbootdemo-wildfly `
148186
149- ` springbootdemo-tomcat11 ` is derived from ` springbootdemo ` (which targets WildFly). The two
150- modules share the same service logic but differ in :
187+ ` springbootdemo-tomcat11 ` and ` springbootdemo-wildfly ` share all Java source and resources
188+ via ` build-helper-maven-plugin ` . The only differences are container-specific :
151189
152- | Aspect | ` springbootdemo ` (WildFly) | ` springbootdemo-tomcat11 ` |
153- | --------| ---------------------------| --------------------------|
154- | Server | WildFly / embedded Undertow | Apache Tomcat 11 |
190+ | Aspect | ` springbootdemo-tomcat11 ` | ` springbootdemo-wildfly ` |
191+ | --------| --------------------------| --------------------------|
192+ | Server | Apache Tomcat 11 | WildFly 32+ (Undertow) |
193+ | Tested on | Tomcat 11.0.20 / Java 21 | WildFly 39 / Java 25 |
194+ | WAR output | ` target/deploy/axis2-json-api/ ` (no ` .war ` suffix) | ` target/deploy/axis2-json-api/ ` |
195+ | Extra WEB-INF files | — | ` jboss-deployment-structure.xml ` , ` jboss-web.xml ` , ` beans.xml ` |
155196| Context path | ` /axis2-json-api ` | ` /axis2-json-api ` |
156- | OpenAPI routing | ` OpenApiServlet ` via ` Axis2WebAppInitializer ` | Same |
157- | H2 BigData service | Yes | Yes |
0 commit comments