| <!DOCTYPE html> | |
| <!-- | |
| | Generated by Apache Maven Doxia Site Renderer 2.1.0 from src/site/markdown/docs/mcp-examples.md at 2026-10-13 | |
| | Rendered using Apache Maven Fluido Skin 2.0.0-M11 | |
| --> | |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <meta name="generator" content="Apache Maven Doxia Site Renderer 2.1.0" /> | |
| <title>MCP Examples: Financial Services on Axis2/Java – Apache Axis2</title> | |
| <link rel="stylesheet" href="../css/apache-maven-fluido-2.0.0-M11.min.css" /> | |
| <link rel="stylesheet" href="../css/site.css" /> | |
| <link rel="stylesheet" href="../css/print.css" media="print" /> | |
| <script src="../js/apache-maven-fluido-2.0.0-M11.min.js"></script> | |
| </head> | |
| <body> | |
| <div class="container-fluid container-fluid-top"> | |
| <header> | |
| <div id="banner"> | |
| <div class="pull-left"><div id="bannerLeft"><h1><a href="https://www.apache.org/"><img class="class java.lang.Object" src="https://www.apache.org/images/asf_logo_wide.png" /> Apache Axis2</a></h1></div></div> | |
| <div class="pull-right"><div id="bannerRight"><h1><a href="https://axis.apache.org/axis2/java/core/"><img class="class java.lang.Object" src="https://axis.apache.org/axis2/java/core/images/axis.jpg" /></a></h1></div></div> | |
| <div class="clear"><hr/></div> | |
| </div> | |
| <div id="breadcrumbs"> | |
| <ul class="breadcrumb"> | |
| <li id="publishDate">Last Published: 2026-10-13<span class="divider">|</span> | |
| </li> | |
| <li id="projectVersion">Version: 2.0.2<span class="divider">|</span></li> | |
| <li><a href="https://www.apache.org" class="externalLink">Apache</a><span class="divider">/</span></li> | |
| <li><a href="../index.html">Axis2/Java</a><span class="divider">/</span></li> | |
| <li class="active">MCP Examples: Financial Services on Axis2/Java</li> | |
| </ul> | |
| </div> | |
| </header> | |
| <div class="row-fluid"> | |
| <header id="leftColumn" class="span2"> | |
| <nav class="well sidebar-nav"> | |
| <ul class="nav nav-list"> | |
| <li class="nav-header">Axis2/Java</li> | |
| <li><a href="../index.html">Home</a></li> | |
| <li><a href="../download.html">Downloads</a></li> | |
| <li><a href="javascript:void(0)"><span class="icon-chevron-down"></span>Release Notes</a> | |
| <ul class="nav nav-list"> | |
| <li><a href="../release-notes/1.6.1.html">1.6.1</a></li> | |
| <li><a href="../release-notes/1.6.2.html">1.6.2</a></li> | |
| <li><a href="../release-notes/1.6.3.html">1.6.3</a></li> | |
| <li><a href="../release-notes/1.6.4.html">1.6.4</a></li> | |
| <li><a href="../release-notes/1.7.0.html">1.7.0</a></li> | |
| <li><a href="../release-notes/1.7.1.html">1.7.1</a></li> | |
| <li><a href="../release-notes/1.7.2.html">1.7.2</a></li> | |
| <li><a href="../release-notes/1.7.3.html">1.7.3</a></li> | |
| <li><a href="../release-notes/1.7.4.html">1.7.4</a></li> | |
| <li><a href="../release-notes/1.7.5.html">1.7.5</a></li> | |
| <li><a href="../release-notes/1.7.6.html">1.7.6</a></li> | |
| <li><a href="../release-notes/1.7.7.html">1.7.7</a></li> | |
| <li><a href="../release-notes/1.7.8.html">1.7.8</a></li> | |
| <li><a href="../release-notes/1.7.9.html">1.7.9</a></li> | |
| <li><a href="../release-notes/1.7.10.html">1.7.10</a></li> | |
| <li><a href="../release-notes/1.8.0.html">1.8.0</a></li> | |
| <li><a href="../release-notes/1.8.1.html">1.8.1</a></li> | |
| <li><a href="../release-notes/1.8.2.html">1.8.2</a></li> | |
| <li><a href="../release-notes/2.0.0.html">2.0.0</a></li> | |
| <li><a href="../release-notes/2.0.1.html">2.0.1</a></li> | |
| <li><a href="../release-notes/2.0.2.html">2.0.2</a></li> | |
| </ul></li> | |
| <li><a href="../modules/index.html">Modules</a></li> | |
| <li><a href="../tools/index.html">Tools</a></li> | |
| <li class="nav-header">Documentation</li> | |
| <li><a href="../docs/toc.html">Table of Contents</a></li> | |
| <li><a href="../docs/installationguide.html">Installation Guide</a></li> | |
| <li><a href="../docs/quickstartguide.html">QuickStart Guide</a></li> | |
| <li><a href="../docs/userguide.html">User Guide</a></li> | |
| <li><a href="../docs/jaxws-guide.html">JAXWS Guide</a></li> | |
| <li><a href="../docs/pojoguide.html">POJO Guide</a></li> | |
| <li><a href="../docs/spring.html">Spring Guide</a></li> | |
| <li><a href="../docs/webadminguide.html">Web Administrator's Guide</a></li> | |
| <li><a href="../docs/migration.html">Migration Guide (from Axis1)</a></li> | |
| <li class="nav-header">Resources</li> | |
| <li><a href="../faq.html">FAQ</a></li> | |
| <li><a href="https://github.com/apache/axis-axis2-java-core" class="externalLink">Source Code</a></li> | |
| <li class="nav-header">Get Involved</li> | |
| <li><a href="../overview.html">Overview</a></li> | |
| <li><a href="../mailing-lists.html">Mailing Lists</a></li> | |
| <li><a href="../release-process.html">Release Process</a></li> | |
| <li><a href="../guidelines.html">Developer Guidelines</a></li> | |
| <li><a href="../siteHowTo.html">Build the Site</a></li> | |
| <li class="nav-header">Project Information</li> | |
| <li><a href="https://github.com/apache/axis-axis2-java-core/graphs/contributors" class="externalLink">Contributors</a></li> | |
| <li><a href="https://issues.apache.org/jira/projects/AXIS2/issues" class="externalLink">Issues</a></li> | |
| <li class="nav-header">Apache</li> | |
| <li><a href="https://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink">License</a></li> | |
| <li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsorship</a></li> | |
| <li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a></li> | |
| <li><a href="https://www.apache.org/security/" class="externalLink">Security</a></li> | |
| </ul> | |
| </nav> | |
| <div class="well sidebar-nav"> | |
| <div id="poweredBy"> | |
| <div class="clear"></div> | |
| <div class="clear"></div> | |
| <a href="https://maven.apache.org/" class="builtBy" target="_blank"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a> | |
| </div> | |
| </div> | |
| </header> | |
| <main id="bodyColumn" class="span10"> | |
| <section><a id="MCP_Examples.3A_Financial_Services_on_Axis2.2FJava"></a> | |
| <h1>MCP Examples: Financial Services on Axis2/Java</h1> | |
| <p><strong>Summary</strong>: Apache Axis2/Java serves the same financial calculations as Axis2/C — portfolio variance, Monte Carlo VaR (GBM and Merton jump-diffusion), scenario analysis — over JSON on WildFly 32/41 and Tomcat 11 with Spring Security JWT authentication. This document shows the same live demos as the Axis2/C <code>MCP_EXAMPLES.md</code>, run against the Java implementation, with head-to-head performance numbers.</p> | |
| <p>The financial results are identical (same algorithms, same inputs, same outputs). The implementations compete only on performance.</p><hr /><section><a id="Transport_and_Timing_Note"></a> | |
| <h2>Transport and Timing Note</h2> | |
| <p>Both Axis2/C and Axis2/Java support <strong>HTTPS/HTTP2</strong>. Axis2/C runs over Apache httpd with mod_h2; Axis2/Java runs over WildFly or Tomcat with ALPN-negotiated HTTP/2 on port 8443. Verified on WildFly 32, WildFly 41, and Tomcat 11 — all negotiate <code>h2</code> via ALPN when accessed over TLS.</p> | |
| <p>All timings in this document use the <strong>server-reported <code>calcTimeUs</code> field</strong> — wall-clock time measured inside the service handler, after request parsing and before response serialization. Transport overhead (TLS, HTTP/2 framing) is excluded. The computation comparison is apples-to-apples.</p><hr /></section><section><a id="Authentication"></a> | |
| <h2>Authentication</h2> | |
| <p>All examples use <strong>HTTPS/HTTP2 on port 8443</strong>. WildFly uses a self-signed certificate, so <code>-k</code> skips certificate verification. Tomcat uses mTLS with CA-signed client certs (see <code>mcp-architecture.md</code> for PKI details).</p> | |
| <p>Axis2/Java requires JWT authentication via Spring Security. All financial service calls need a <code>Bearer</code> token obtained from the login endpoint:</p> | |
| <pre class="prettyprint"><code class="language-bash">TOKEN=$(curl -s --http2 -k https://localhost:8443/axis2-json-api/services/loginService \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"doLogin":[{"arg0":{"email":"java-dev@axis.apache.org","credentials":"userguide"}}]}' \ | |
| | python3 -c "import sys,json; print(json.load(sys.stdin)['response']['token'])") | |
| </code></pre> | |
| <p>All subsequent examples assume <code>$TOKEN</code> is set.</p><hr /></section><section><a id="API_Differences.3A_Java_vs_C"></a> | |
| <h2>API Differences: Java vs C</h2> | |
| <p>The financial calculations are identical. The wire format differs:</p> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th></th> | |
| <th>Axis2/C</th> | |
| <th>Axis2/Java</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td>URL pattern</td> | |
| <td><code>.../portfolioVariance</code></td> | |
| <td><code>.../FinancialBenchmarkService</code></td></tr> | |
| <tr class="a"> | |
| <td>Request format</td> | |
| <td><code>{"n_assets": 5, ...}</code></td> | |
| <td><code>{"portfolioVariance":[{"arg0":{...}}]}</code></td></tr> | |
| <tr class="b"> | |
| <td>Response format</td> | |
| <td><code>{"status": "SUCCESS", ...}</code></td> | |
| <td><code>{"response": {"status": "SUCCESS", ...}}</code></td></tr> | |
| <tr class="a"> | |
| <td>Field naming</td> | |
| <td><code>snake_case</code></td> | |
| <td><code>camelCase</code></td></tr> | |
| <tr class="b"> | |
| <td>Authentication</td> | |
| <td>None (HTTP/2 + TLS)</td> | |
| <td>JWT Bearer token</td></tr> | |
| <tr class="a"> | |
| <td>Memory field</td> | |
| <td><code>memory_used_kb</code> (KB)</td> | |
| <td><code>memoryUsedMb</code> (MB)</td></tr> | |
| <tr class="b"> | |
| <td>Covariance input</td> | |
| <td>Flat array (row-major)</td> | |
| <td>2D array <code>[[...],[...]]</code></td></tr></tbody> | |
| </table> | |
| <hr /></section><section><a id="MCP_Bridge"></a> | |
| <h2>MCP Bridge</h2> | |
| <p>Axis2/Java exposes MCP via <code>axis2-mcp-bridge</code>, a stdio JAR that reads <code>/openapi-mcp.json</code> and proxies <code>tools/call</code> to the Axis2 service. The bridge handles authentication (mTLS on Tomcat, JWT on WildFly) so the AI client sees only standard MCP JSON-RPC.</p> | |
| <p><strong>Claude Desktop configuration</strong> (WildFly, JWT auth):</p> | |
| <pre class="prettyprint"><code class="language-json">{ | |
| "mcpServers": { | |
| "axis2-java-finbench": { | |
| "command": "java", | |
| "args": ["-jar", "/path/to/axis2-mcp-bridge-2.0.2-exe.jar", | |
| "--base-url", "https://localhost:8443/axis2-json-api"] | |
| } | |
| } | |
| } | |
| </code></pre> | |
| <p><strong>MCP stdio call format</strong> (what the bridge sends/receives):</p> | |
| <pre class="prettyprint"><code class="language-bash">echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{ | |
| "name":"portfolioVariance","arguments":{...}}}' \ | |
| | java -jar axis2-mcp-bridge-2.0.2-exe.jar \ | |
| --base-url https://localhost:8443/axis2-json-api | |
| </code></pre> | |
| <p>All curl examples below include paired MCP stdio equivalents.</p><hr /></section><section><a id="Live_Examples_.28Tested_on_WildFly_32.2F41_and_Tomcat_11.29"></a> | |
| <h2>Live Examples (Tested on WildFly 32/41 and Tomcat 11)</h2><section><a id="Portfolio_Variance_.E2.80.94_5_assets"></a> | |
| <h3>Portfolio Variance — 5 assets</h3> | |
| <pre class="prettyprint"><code class="language-bash">curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"portfolioVariance":[{"arg0":{ | |
| "nAssets": 5, | |
| "weights": [0.25, 0.25, 0.20, 0.15, 0.15], | |
| "covarianceMatrix": [ | |
| [0.0691, 0.0313, 0.0457, 0.0272, -0.0035], | |
| [0.0313, 0.0976, 0.0591, 0.0408, 0.0058], | |
| [0.0457, 0.0591, 0.1207, 0.0437, -0.0086], | |
| [0.0272, 0.0408, 0.0437, 0.0638, 0.0015], | |
| [-0.0035, 0.0058,-0.0086, 0.0015, 0.0303] | |
| ], | |
| "normalizeWeights": true | |
| }}]}' | |
| </code></pre> | |
| <pre class="prettyprint"><code class="language-json">{ | |
| "response": { | |
| "status": "SUCCESS", | |
| "portfolioVariance": 0.0392, | |
| "portfolioVolatility": 0.198, | |
| "annualizedVolatility": 3.143, | |
| "calcTimeUs": 1, | |
| "matrixOperations": 25, | |
| "memoryUsedMb": 198, | |
| "runtimeInfo": "Java (JVM heap tier: < 2 GB)" | |
| } | |
| } | |
| </code></pre> | |
| <p><strong>MCP stdio equivalent:</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"portfolioVariance","arguments":{"nAssets":5,"weights":[0.25,0.25,0.20,0.15,0.15],"covarianceMatrix":[[0.0691,0.0313,0.0457,0.0272,-0.0035],[0.0313,0.0976,0.0591,0.0408,0.0058],[0.0457,0.0591,0.1207,0.0437,-0.0086],[0.0272,0.0408,0.0437,0.0638,0.0015],[-0.0035,0.0058,-0.0086,0.0015,0.0303]],"normalizeWeights":true}}}' \ | |
| | java -jar axis2-mcp-bridge-2.0.2-exe.jar --base-url https://localhost:8443/axis2-json-api | |
| </code></pre></section><section><a id="Portfolio_Variance_.E2.80.94_500_assets"></a> | |
| <h3>Portfolio Variance — 500 assets</h3> | |
| <pre class="prettyprint"><code class="language-bash"># Generate 500-asset test data | |
| python3 -c " | |
| import json | |
| n=500; w=[1.0/n]*n; c=[] | |
| for i in range(n): | |
| row=[] | |
| for j in range(n): | |
| if i==j: row.append(0.04) | |
| else: row.append(0.01*max(0,1.0-abs(i-j)/50.0)) | |
| c.append(row) | |
| print(json.dumps({'portfolioVariance':[{'arg0':{'nAssets':n,'weights':w,'covarianceMatrix':c}}]}))" \ | |
| > /tmp/pv500.json | |
| curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d @/tmp/pv500.json | |
| </code></pre> | |
| <pre class="prettyprint"><code class="language-json">{ | |
| "response": { | |
| "status": "SUCCESS", | |
| "portfolioVariance": 0.001027, | |
| "portfolioVolatility": 0.0320, | |
| "calcTimeUs": 660, | |
| "matrixOperations": 250000, | |
| "memoryUsedMb": 229 | |
| } | |
| } | |
| </code></pre> | |
| <p>(MCP equivalent omitted for 500-asset — the arguments object is identical, just wrapped in <code>tools/call</code> JSON-RPC as shown above.)</p></section><section><a id="Monte_Carlo_VaR_.E2.80.94_100K_simulations"></a> | |
| <h3>Monte Carlo VaR — 100K simulations</h3> | |
| <p>Monte Carlo Value at Risk estimates portfolio loss at a given confidence level by simulating thousands of random price paths. The default model is Geometric Brownian Motion (GBM): <code>S(t+dt) = S(t) × exp((μ − σ²/2)·dt + σ·√dt·Z)</code> where Z ~ N(0,1). A Merton jump-diffusion model is also available (<code>"model":"merton"</code>) which adds Poisson-distributed jumps for fat-tailed scenarios — configurable via <code>jumpIntensity</code>, <code>jumpMean</code>, and <code>jumpVol</code> parameters. Run 100,000 paths, sort the terminal values, read off the 1st percentile loss — that's your 99% VaR. Production risk systems run this nightly for regulatory capital calculations.</p> | |
| <pre class="prettyprint"><code class="language-bash">curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"monteCarlo":[{"arg0":{ | |
| "nSimulations": 100000, | |
| "nPeriods": 252, | |
| "initialValue": 1000000, | |
| "expectedReturn": 0.10, | |
| "volatility": 0.198, | |
| "nPeriodsPerYear": 252 | |
| }}]}' | |
| </code></pre> | |
| <pre class="prettyprint"><code class="language-json">{ | |
| "response": { | |
| "status": "SUCCESS", | |
| "meanFinalValue": 1104699.76, | |
| "var95": 219309.63, | |
| "var99": 317526.89, | |
| "cvar95": 279538.64, | |
| "maxDrawdown": 0.567, | |
| "probProfit": 0.657, | |
| "calcTimeUs": 1380378, | |
| "simulationsPerSecond": 72443, | |
| "memoryUsedMb": 142 | |
| } | |
| } | |
| </code></pre> | |
| <p><strong>MCP stdio equivalent:</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"monteCarlo","arguments":{"nSimulations":100000,"nPeriods":252,"initialValue":1000000,"expectedReturn":0.10,"volatility":0.198,"nPeriodsPerYear":252}}}' \ | |
| | java -jar axis2-mcp-bridge-2.0.2-exe.jar --base-url https://localhost:8443/axis2-json-api | |
| </code></pre><hr /></section></section><section><a id="Demo_1.3A_Stress-test_.E2.80.94_.E2.80.9CWhat_if_correlations_spike.3F.E2.80.9D"></a> | |
| <h2>Demo 1: Stress-test — “What if correlations spike?”</h2> | |
| <p>Same test as Axis2/C <code>MCP_EXAMPLES.md</code> Demo 1. Baseline portfolio at real market correlations, then stressed to ρ = 0.8, then Monte Carlo on the stressed portfolio.</p> | |
| <p>Each curl below has an MCP equivalent — same <code>tools/call</code> pattern as the Live Examples above, with the arguments object matching the <code>arg0</code> payload. The bridge handles the Axis2 JSON-RPC wrapping transparently.</p> | |
| <p><strong>Step 1 — Baseline:</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"portfolioVariance":[{"arg0":{ | |
| "nAssets": 5, | |
| "weights": [0.25, 0.25, 0.20, 0.15, 0.15], | |
| "covarianceMatrix": [ | |
| [0.0691, 0.0313, 0.0457, 0.0272, -0.0035], | |
| [0.0313, 0.0976, 0.0591, 0.0408, 0.0058], | |
| [0.0457, 0.0591, 0.1207, 0.0437, -0.0086], | |
| [0.0272, 0.0408, 0.0437, 0.0638, 0.0015], | |
| [-0.0035, 0.0058,-0.0086, 0.0015, 0.0303] | |
| ], | |
| "normalizeWeights": true | |
| }}]}' | |
| </code></pre> | |
| <pre class="prettyprint"><code class="language-json">{ | |
| "response": { | |
| "status": "SUCCESS", | |
| "portfolioVariance": 0.0392, | |
| "portfolioVolatility": 0.198, | |
| "calcTimeUs": 1, | |
| "memoryUsedMb": 198 | |
| } | |
| } | |
| </code></pre> | |
| <p><strong>Step 2 — Stressed (all pairwise correlations → 0.8):</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"portfolioVariance":[{"arg0":{ | |
| "nAssets": 5, | |
| "weights": [0.25, 0.25, 0.20, 0.15, 0.15], | |
| "covarianceMatrix": [ | |
| [0.0691, 0.0656, 0.0730, 0.0530, 0.0366], | |
| [0.0656, 0.0974, 0.0866, 0.0629, 0.0434], | |
| [0.0730, 0.0866, 0.1204, 0.0699, 0.0483], | |
| [0.0530, 0.0629, 0.0699, 0.0635, 0.0351], | |
| [0.0366, 0.0434, 0.0483, 0.0351, 0.0303] | |
| ], | |
| "normalizeWeights": true | |
| }}]}' | |
| </code></pre> | |
| <pre class="prettyprint"><code class="language-json">{ | |
| "response": { | |
| "status": "SUCCESS", | |
| "portfolioVariance": 0.0649, | |
| "portfolioVolatility": 0.2547, | |
| "calcTimeUs": 1, | |
| "memoryUsedMb": 198 | |
| } | |
| } | |
| </code></pre> | |
| <p><strong>Step 3 — Monte Carlo on stressed portfolio (100K paths):</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"monteCarlo":[{"arg0":{ | |
| "nSimulations": 100000, | |
| "nPeriods": 252, | |
| "initialValue": 1000000, | |
| "expectedReturn": 0.10, | |
| "volatility": 0.255, | |
| "nPeriodsPerYear": 252 | |
| }}]}' | |
| </code></pre> | |
| <pre class="prettyprint"><code class="language-json">{ | |
| "response": { | |
| "status": "SUCCESS", | |
| "meanFinalValue": 1104718.26, | |
| "var95": 296582.35, | |
| "var99": 409644.96, | |
| "cvar95": 364494.42, | |
| "maxDrawdown": 0.668, | |
| "probProfit": 0.602, | |
| "calcTimeUs": 1437421, | |
| "simulationsPerSecond": 69569 | |
| } | |
| } | |
| </code></pre> | |
| <p><strong>MCP stdio equivalent (stressed MC):</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"monteCarlo","arguments":{"nSimulations":100000,"nPeriods":252,"initialValue":1000000,"expectedReturn":0.10,"volatility":0.255,"nPeriodsPerYear":252}}}' \ | |
| | java -jar axis2-mcp-bridge-2.0.2-exe.jar --base-url https://localhost:8443/axis2-json-api | |
| </code></pre> | |
| <p><strong>Comparison — Axis2/C vs Axis2/Java (same inputs, same day):</strong></p> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th>Metric</th> | |
| <th>Normal ρ</th> | |
| <th>Stressed ρ = 0.8</th> | |
| <th>Change</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td>Portfolio vol</td> | |
| <td>19.8%</td> | |
| <td>25.5%</td> | |
| <td><strong>+29%</strong></td></tr> | |
| <tr class="a"> | |
| <td>95% VaR (1yr, $1M)</td> | |
| <td>$219K</td> | |
| <td>$297K</td> | |
| <td><strong>+$78K</strong></td></tr> | |
| <tr class="b"> | |
| <td>99% VaR</td> | |
| <td>$318K</td> | |
| <td>$410K</td> | |
| <td><strong>+$92K</strong></td></tr> | |
| <tr class="a"> | |
| <td>Prob of profit</td> | |
| <td>65.7%</td> | |
| <td>60.2%</td> | |
| <td>-5.5pp</td></tr></tbody> | |
| </table> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th>Timing</th> | |
| <th>Axis2/C</th> | |
| <th>Axis2/Java</th> | |
| <th>Ratio</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td><code>portfolioVariance</code> (×2)</td> | |
| <td><1 μs each</td> | |
| <td>1 μs each</td> | |
| <td>~1x</td></tr> | |
| <tr class="a"> | |
| <td><code>monteCarlo</code> (100K)</td> | |
| <td>727 ms</td> | |
| <td>1,437 ms</td> | |
| <td><strong>2.0x</strong></td></tr> | |
| <tr class="b"> | |
| <td>Total compute</td> | |
| <td>~0.73 sec</td> | |
| <td>~1.44 sec</td> | |
| <td>2.0x</td></tr></tbody> | |
| </table> | |
| <p>Both produce the same financial results. Java's Monte Carlo is ~2x slower on this run; the JIT-warmed steady state is typically 1.3-1.5x (see convergence section below).</p><hr /></section><section><a id="Demo_2.3A_Pre-trade_risk_.E2.80.94_.E2.80.9CShould_I_add_this_name.3F.E2.80.9D"></a> | |
| <h2>Demo 2: Pre-trade risk — “Should I add this name?”</h2> | |
| <p>Same test as Axis2/C Demo 2. Two candidate 6-asset portfolios: European semiconductor (high correlation to existing tech) vs Japanese peer (low correlation). All calls have MCP equivalents via the bridge (same pattern as Live Examples).</p> | |
| <p><strong>Candidate A — European semi (vol 44%, ρ = 0.68 to tech):</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"portfolioVariance":[{"arg0":{ | |
| "nAssets": 6, | |
| "weights": [0.2425, 0.2425, 0.194, 0.1455, 0.1455, 0.03], | |
| "covarianceMatrix": [ | |
| [0.0691, 0.0313, 0.0457, 0.0272,-0.0035, 0.0787], | |
| [0.0313, 0.0976, 0.0591, 0.0408, 0.0058, 0.0934], | |
| [0.0457, 0.0591, 0.1207, 0.0437,-0.0086, 0.1039], | |
| [0.0272, 0.0408, 0.0437, 0.0638, 0.0015, 0.0610], | |
| [-0.0035, 0.0058,-0.0086, 0.0015, 0.0303, 0.0115], | |
| [0.0787, 0.0934, 0.1039, 0.0610, 0.0115, 0.1936] | |
| ], | |
| "normalizeWeights": true | |
| }}]}' | |
| </code></pre> | |
| <pre class="prettyprint"><code class="language-json">{"response": {"status": "SUCCESS", "portfolioVolatility": 0.2035, "calcTimeUs": 1}} | |
| </code></pre> | |
| <p><strong>Candidate B — Japanese peer (vol 38%, ρ = 0.31 to US tech):</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"portfolioVariance":[{"arg0":{ | |
| "nAssets": 6, | |
| "weights": [0.2425, 0.2425, 0.194, 0.1455, 0.1455, 0.03], | |
| "covarianceMatrix": [ | |
| [0.0691, 0.0313, 0.0457, 0.0272,-0.0035, 0.0310], | |
| [0.0313, 0.0976, 0.0591, 0.0408, 0.0058, 0.0368], | |
| [0.0457, 0.0591, 0.1207, 0.0437,-0.0086, 0.0409], | |
| [0.0272, 0.0408, 0.0437, 0.0638, 0.0015, 0.0239], | |
| [-0.0035, 0.0058,-0.0086, 0.0015, 0.0303, 0.0066], | |
| [0.0310, 0.0368, 0.0409, 0.0239, 0.0066, 0.1444] | |
| ], | |
| "normalizeWeights": true | |
| }}]}' | |
| </code></pre> | |
| <pre class="prettyprint"><code class="language-json">{"response": {"status": "SUCCESS", "portfolioVolatility": 0.1968, "calcTimeUs": 1}} | |
| </code></pre> | |
| <p><strong>Head-to-head Monte Carlo (100K paths each):</strong></p> | |
| <pre class="prettyprint"><code class="language-bash"># European candidate (vol 21.1%) | |
| curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"monteCarlo":[{"arg0":{"nSimulations":100000,"nPeriods":252, | |
| "initialValue":1000000,"expectedReturn":0.10,"volatility":0.211, | |
| "nPeriodsPerYear":252}}]}' | |
| # Japanese candidate (vol 20.1%) | |
| curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"monteCarlo":[{"arg0":{"nSimulations":100000,"nPeriods":252, | |
| "initialValue":1000000,"expectedReturn":0.10,"volatility":0.201, | |
| "nPeriodsPerYear":252}}]}' | |
| </code></pre> | |
| <p><strong>European candidate response:</strong></p> | |
| <pre class="prettyprint"><code class="language-json">{"response": {"var95": 237481, "var99": 340245, "cvar95": 300412, "probProfit": 0.643, "maxDrawdown": 0.610, "calcTimeUs": 1360351}} | |
| </code></pre> | |
| <p><strong>Japanese candidate response:</strong></p> | |
| <pre class="prettyprint"><code class="language-json">{"response": {"var95": 221367, "var99": 322087, "cvar95": 282371, "probProfit": 0.656, "maxDrawdown": 0.555, "calcTimeUs": 1364834}} | |
| </code></pre> | |
| <p><strong>Results summary (2026-04-08):</strong></p> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th></th> | |
| <th>Before (5 names)</th> | |
| <th>+ European semi</th> | |
| <th>+ Japanese peer</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td>Portfolio vol</td> | |
| <td>19.8%</td> | |
| <td><strong>20.3%</strong> (+55bp)</td> | |
| <td><strong>19.7%</strong> (-13bp)</td></tr> | |
| <tr class="a"> | |
| <td>95% VaR ($1M)</td> | |
| <td>$219K</td> | |
| <td>$237K</td> | |
| <td>$221K</td></tr> | |
| <tr class="b"> | |
| <td>99% VaR</td> | |
| <td>$318K</td> | |
| <td>$340K</td> | |
| <td>$322K</td></tr> | |
| <tr class="a"> | |
| <td>CVaR 95%</td> | |
| <td>$280K</td> | |
| <td>$300K</td> | |
| <td>$282K</td></tr> | |
| <tr class="b"> | |
| <td>Prob of profit</td> | |
| <td>65.7%</td> | |
| <td>64.3%</td> | |
| <td>65.6%</td></tr></tbody> | |
| </table> | |
| <p><strong>Timing comparison:</strong></p> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th>Call</th> | |
| <th>Axis2/C</th> | |
| <th>Axis2/Java</th> | |
| <th>Ratio</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td><code>portfolioVariance</code> (×4)</td> | |
| <td><1 μs each</td> | |
| <td>1 μs each</td> | |
| <td>~1x</td></tr> | |
| <tr class="a"> | |
| <td><code>monteCarlo</code> European</td> | |
| <td>716 ms</td> | |
| <td>1,360 ms</td> | |
| <td>1.9x</td></tr> | |
| <tr class="b"> | |
| <td><code>monteCarlo</code> Japanese</td> | |
| <td>672 ms</td> | |
| <td>1,365 ms</td> | |
| <td>2.0x</td></tr> | |
| <tr class="a"> | |
| <td>Total compute</td> | |
| <td>~1.4 sec</td> | |
| <td>~2.7 sec</td> | |
| <td>1.9x</td></tr></tbody> | |
| </table> | |
| <p>Financial conclusions are identical — the Japanese name provides genuine diversification. Java takes roughly twice as long for the Monte Carlo simulations.</p><hr /></section><section><a id="Demo_3.3A_Convergence_.E2.80.94_.E2.80.9CHow_much_compute_do_I_actually_need.3F.E2.80.9D"></a> | |
| <h2>Demo 3: Convergence — “How much compute do I actually need?”</h2> | |
| <p>Run <code>monteCarlo</code> at 1K, 10K, 100K, and 1M paths:</p> | |
| <pre class="prettyprint"><code class="language-bash">for N in 1000 10000 100000 1000000; do | |
| curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d "{\"monteCarlo\":[{\"arg0\":{\"nSimulations\":$N,\"nPeriods\":252, | |
| \"initialValue\":1000000,\"expectedReturn\":0.10,\"volatility\":0.198, | |
| \"nPeriodsPerYear\":252}}]}" | |
| done | |
| </code></pre> | |
| <p><strong>MCP stdio equivalent (example for 100K):</strong></p> | |
| <pre class="prettyprint"><code class="language-bash">echo '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"monteCarlo","arguments":{"nSimulations":100000,"nPeriods":252,"initialValue":1000000,"expectedReturn":0.10,"volatility":0.198,"nPeriodsPerYear":252}}}' \ | |
| | java -jar axis2-mcp-bridge-2.0.2-exe.jar --base-url https://localhost:8443/axis2-json-api | |
| </code></pre> | |
| <p><strong>Axis2/Java results (2026-04-08):</strong></p> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th>Simulations</th> | |
| <th>95% VaR</th> | |
| <th>99% VaR</th> | |
| <th>Calc time</th> | |
| <th>Sims/sec</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td>1,000</td> | |
| <td>$221,665</td> | |
| <td>$325,340</td> | |
| <td><strong>13 ms</strong></td> | |
| <td>77,863</td></tr> | |
| <tr class="a"> | |
| <td>10,000</td> | |
| <td>$216,407</td> | |
| <td>$312,895</td> | |
| <td><strong>136 ms</strong></td> | |
| <td>73,378</td></tr> | |
| <tr class="b"> | |
| <td>100,000</td> | |
| <td>$218,868</td> | |
| <td>$315,163</td> | |
| <td><strong>1.37 sec</strong></td> | |
| <td>73,211</td></tr> | |
| <tr class="a"> | |
| <td>1,000,000</td> | |
| <td>$217,286</td> | |
| <td>$315,700</td> | |
| <td><strong>13.8 sec</strong></td> | |
| <td>72,710</td></tr></tbody> | |
| </table> | |
| <p><strong>Head-to-head with Axis2/C (same inputs, same machine):</strong></p> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th>Simulations</th> | |
| <th>C time</th> | |
| <th>Java time</th> | |
| <th>Ratio</th> | |
| <th>C sims/sec</th> | |
| <th>Java sims/sec</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td>1,000</td> | |
| <td>6 ms</td> | |
| <td>13 ms</td> | |
| <td>2.1x</td> | |
| <td>164,295</td> | |
| <td>77,863</td></tr> | |
| <tr class="a"> | |
| <td>10,000</td> | |
| <td>66 ms</td> | |
| <td>136 ms</td> | |
| <td>2.1x</td> | |
| <td>152,423</td> | |
| <td>73,378</td></tr> | |
| <tr class="b"> | |
| <td>100,000</td> | |
| <td>716 ms</td> | |
| <td>1,370 ms</td> | |
| <td>1.9x</td> | |
| <td>139,650</td> | |
| <td>73,211</td></tr> | |
| <tr class="a"> | |
| <td>1,000,000</td> | |
| <td>6.6 sec</td> | |
| <td>13.8 sec</td> | |
| <td>2.1x</td> | |
| <td>150,773</td> | |
| <td>72,710</td></tr></tbody> | |
| </table> | |
| <p>The ratio is a consistent <strong>~2x</strong> across all simulation counts. C processes ~150K simulations/sec vs Java's ~73K sims/sec.</p> | |
| <p><strong>Production capacity math (Java)</strong>: at 1.37 sec per 100K-path run, a single core processes <strong>44 funds per minute</strong>. A 500-fund universe completes in ~11.4 minutes on one core, or <strong>~69 seconds on a 10-core node</strong>.</p> | |
| <p>For comparison, Axis2/C: 500 funds in 6 minutes on one core, 36 seconds on 10 cores.</p><hr /></section><section><a id="a500-Asset_Portfolio_Variance_.E2.80.94_The_Big_Comparison"></a> | |
| <h2>500-Asset Portfolio Variance — The Big Comparison</h2> | |
| <p>This is where the gap widens. O(n^2) matrix math at n=500 means 250,000 multiply-accumulate operations on a flat array (C) vs a 2D Java array with bounds checking.</p> | |
| <p><strong>Axis2/C:</strong></p> | |
| <pre class="prettyprint"><code class="language-json">{"portfolio_volatility": 0.0320, "calc_time_us": 232, "matrix_operations": 250000} | |
| </code></pre> | |
| <p><strong>Axis2/Java:</strong></p> | |
| <pre class="prettyprint"><code class="language-json">{"portfolioVolatility": 0.0320, "calcTimeUs": 660, "matrixOperations": 250000} | |
| </code></pre> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th></th> | |
| <th>Axis2/C</th> | |
| <th>Axis2/Java</th> | |
| <th>Ratio</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td>Calc time</td> | |
| <td><strong>232 μs</strong></td> | |
| <td><strong>660 μs</strong></td> | |
| <td>2.8x</td></tr> | |
| <tr class="a"> | |
| <td>Memory</td> | |
| <td>~193 MB RSS</td> | |
| <td>229 MB heap</td> | |
| <td>1.2x</td></tr> | |
| <tr class="b"> | |
| <td>Result</td> | |
| <td>0.0320</td> | |
| <td>0.0320</td> | |
| <td>identical</td></tr></tbody> | |
| </table> | |
| <p>At 500 assets Java is 2.8x slower — the JVM's array bounds checking and object overhead becomes measurable at O(n^2). Both are still sub-millisecond, which is fast enough for interactive use.</p><hr /></section><section><a id="Full_Performance_Summary"></a> | |
| <h2>Full Performance Summary</h2> | |
| <p>All measurements from 2026-04-08, same machine (Linux, 32 GB RAM). Timings are server-reported <code>calcTimeUs</code> — pure computation time, no transport overhead. Monte Carlo timings vary ±5% across runs due to JIT warmup and GC; values below are from the Demo 3 convergence runs (JIT-warm steady state).</p> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th>Benchmark</th> | |
| <th>Axis2/C</th> | |
| <th>Axis2/Java</th> | |
| <th>Ratio</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td>portfolioVariance (5 assets)</td> | |
| <td><1 μs</td> | |
| <td>1 μs</td> | |
| <td>~1x</td></tr> | |
| <tr class="a"> | |
| <td>portfolioVariance (500 assets)</td> | |
| <td>232 μs</td> | |
| <td>660 μs</td> | |
| <td>2.8x</td></tr> | |
| <tr class="b"> | |
| <td>monteCarlo (1K × 252)</td> | |
| <td>6 ms</td> | |
| <td>13 ms</td> | |
| <td>2.1x</td></tr> | |
| <tr class="a"> | |
| <td>monteCarlo (10K × 252)</td> | |
| <td>66 ms</td> | |
| <td>136 ms</td> | |
| <td>2.1x</td></tr> | |
| <tr class="b"> | |
| <td>monteCarlo (100K × 252)</td> | |
| <td>716 ms</td> | |
| <td>1,366 ms</td> | |
| <td>1.9x</td></tr> | |
| <tr class="a"> | |
| <td>monteCarlo (1M × 252)</td> | |
| <td>6.6 sec</td> | |
| <td>13.8 sec</td> | |
| <td>2.1x</td></tr> | |
| <tr class="b"> | |
| <td>MC throughput (sims/sec)</td> | |
| <td>~150K</td> | |
| <td>~73K</td> | |
| <td>2.1x</td></tr> | |
| <tr class="a"> | |
| <td>Peak memory (500-asset PV)</td> | |
| <td>~193 MB</td> | |
| <td>229 MB</td> | |
| <td>1.2x</td></tr> | |
| <tr class="b"> | |
| <td>Peak memory (100K MC)</td> | |
| <td>~44 MB</td> | |
| <td>142 MB</td> | |
| <td>3.2x</td></tr> | |
| <tr class="a"> | |
| <td>Startup</td> | |
| <td>instant</td> | |
| <td>~7 sec (WildFly)</td> | |
| <td>N/A</td></tr></tbody> | |
| </table> | |
| <section><a id="When_to_use_which"></a> | |
| <h3>When to use which</h3> | |
| <ul> | |
| <li> | |
| <p><strong>Axis2/C</strong>: Edge devices, Android (1-2 GB RAM), IoT gateways, latency-critical paths, environments where a JVM cannot run or its memory overhead is unacceptable. Sub-millisecond portfolio variance at 500 assets. Startup in milliseconds.</p></li> | |
| <li> | |
| <p><strong>Axis2/Java</strong>: Standard Java EE/Jakarta EE deployment on WildFly or Tomcat, teams with existing Java infrastructure, environments requiring Spring Security (JWT/mTLS), or integration with Java-based data providers. 2x slower on Monte Carlo but still interactive (1.4 sec for 100K paths). Deploys as a standard WAR with OpenAPI/Swagger UI and MCP bridge included.</p></li> | |
| </ul> | |
| <p>Both implement the same MCP tool schemas. An AI assistant configured with either backend gets the same financial capabilities — the same questions produce the same answers. The choice is deployment context, not functionality.</p><hr /></section></section><section><a id="MCP_Tool_Discovery"></a> | |
| <h2>MCP Tool Discovery</h2> | |
| <p>Axis2/Java exposes an MCP tool catalog at:</p> | |
| <pre class="prettyprint"><code class="nohighlight nocode">GET https://localhost:8443/axis2-json-api/openapi-mcp.json | |
| </code></pre> | |
| <p>This endpoint returns the same tool schema structure that Claude Desktop and other MCP clients consume. The catalog includes <code>doLogin</code>, <code>portfolioVariance</code>, <code>monteCarlo</code>, and <code>scenarioAnalysis</code> — each with full input schemas, parameter types, constraints, and defaults. The three financial tools are identical in capability to the Axis2/C MCP stdio server.</p><hr /></section><section><a id="Container.2FJDK_Testing_Matrix"></a> | |
| <h2>Container/JDK Testing Matrix</h2> | |
| <p>MCP bridge and OpenAPI endpoints have been validated across the supported containers and JDK versions:</p> | |
| <table class="table table-striped"> | |
| <thead> | |
| <tr class="a"> | |
| <th>Container</th> | |
| <th>JDK</th> | |
| <th>MCP Bridge</th> | |
| <th>OpenAPI/Swagger UI</th> | |
| <th>Status</th></tr></thead><tbody> | |
| <tr class="b"> | |
| <td>WildFly 32</td> | |
| <td>OpenJDK 21</td> | |
| <td>✅ Tested</td> | |
| <td>✅ Tested</td> | |
| <td>Validated</td></tr> | |
| <tr class="a"> | |
| <td>WildFly 41</td> | |
| <td>OpenJDK 21, 25</td> | |
| <td>✅ Tested</td> | |
| <td>✅ Tested</td> | |
| <td>Validated</td></tr> | |
| <tr class="b"> | |
| <td>Tomcat 11</td> | |
| <td>OpenJDK 21</td> | |
| <td>✅ Tested</td> | |
| <td>✅ Tested</td> | |
| <td>Validated</td></tr> | |
| <tr class="a"> | |
| <td>Tomcat 11</td> | |
| <td>OpenJDK 25</td> | |
| <td>✅ Tested</td> | |
| <td>✅ Tested</td> | |
| <td>Validated</td></tr></tbody> | |
| </table> | |
| <p>All four container/JDK combinations negotiate HTTP/2 via ALPN over TLS.</p><hr /></section><section><a id="Build_and_Deploy"></a> | |
| <h2>Build and Deploy</h2><section><a id="WildFly"></a> | |
| <h3>WildFly</h3> | |
| <p>Full build, deploy, and test instructions are in <code>modules/samples/userguide/src/userguide/springbootdemo-wildfly/README.md</code>. Quick start:</p> | |
| <pre class="prettyprint"><code class="language-bash">cd modules/samples/userguide/src/userguide/springbootdemo-wildfly | |
| mvn -Dmaven.test.skip.exec clean install | |
| # Deploy exploded WAR to WildFly | |
| rsync -a --delete target/deploy/axis2-json-api/ ~/wildfly/standalone/deployments/axis2-json-api.war/ | |
| touch ~/wildfly/standalone/deployments/axis2-json-api.war.dodeploy | |
| </code></pre></section><section><a id="Tomcat_11"></a> | |
| <h3>Tomcat 11</h3> | |
| <p>Full build, deploy, and test instructions are in <code>modules/samples/userguide/src/userguide/springbootdemo-tomcat11/README.md</code>. Quick start:</p> | |
| <pre class="prettyprint"><code class="language-bash">cd modules/samples/userguide/src/userguide/springbootdemo-tomcat11 | |
| mvn -Dmaven.test.skip.exec clean install | |
| # Deploy exploded WAR to Tomcat | |
| cp -r target/deploy/axis2-json-api /path/to/tomcat/webapps/ | |
| </code></pre></section><section><a id="Verify_all_endpoints_after_deploy"></a> | |
| <h3>Verify all endpoints after deploy</h3> | |
| <p><strong>Tomcat 11</strong> (HTTPS/HTTP2 on port 8443 with mTLS):</p> | |
| <pre class="prettyprint"><code class="language-bash">CERTS=/path/to/axis-axis2-java-core/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/certs | |
| CURL_MTLS="curl -s --http2 --cert $CERTS/client.crt --key $CERTS/client.key --cacert $CERTS/ca.crt" | |
| # OpenAPI and MCP (no auth required, but mTLS handshake still needed) | |
| $CURL_MTLS https://localhost:8443/axis2-json-api/openapi.json | |
| $CURL_MTLS https://localhost:8443/axis2-json-api/openapi.yaml | |
| $CURL_MTLS https://localhost:8443/axis2-json-api/openapi-mcp.json | |
| $CURL_MTLS https://localhost:8443/axis2-json-api/swagger-ui | |
| # Login | |
| TOKEN=$($CURL_MTLS -X POST https://localhost:8443/axis2-json-api/services/loginService \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"doLogin":[{"arg0":{"email":"java-dev@axis.apache.org","credentials":"userguide"}}]}' \ | |
| | python3 -c "import sys,json; print(json.load(sys.stdin)['response']['token'])") | |
| # Financial benchmark | |
| $CURL_MTLS -X POST https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"portfolioVariance":[{"arg0":{"nAssets":2,"weights":[0.6,0.4],"covarianceMatrix":[[0.04,0.006],[0.006,0.09]]}}]}' | |
| </code></pre> | |
| <p><strong>WildFly 32/41</strong> (HTTPS/HTTP2 on port 8443 with self-signed cert, JWT auth):</p> | |
| <pre class="prettyprint"><code class="language-bash"># OpenAPI and MCP | |
| curl -s --http2 -k https://localhost:8443/axis2-json-api/openapi.json | |
| curl -s --http2 -k https://localhost:8443/axis2-json-api/openapi-mcp.json | |
| # Login + financial benchmark | |
| TOKEN=$(curl -s --http2 -k https://localhost:8443/axis2-json-api/services/loginService \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"doLogin":[{"arg0":{"email":"java-dev@axis.apache.org","credentials":"userguide"}}]}' \ | |
| | python3 -c "import sys,json; print(json.load(sys.stdin)['response']['token'])") | |
| curl -s --http2 -k https://localhost:8443/axis2-json-api/services/FinancialBenchmarkService \ | |
| -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" \ | |
| -d '{"portfolioVariance":[{"arg0":{"nAssets":2,"weights":[0.6,0.4],"covarianceMatrix":[[0.04,0.006],[0.006,0.09]]}}]}' | |
| </code></pre> | |
| <p>See the sample READMEs for the complete test flow covering all services.</p><hr /></section></section><section><a id="WildFly_Deployment_Notes"></a> | |
| <h2>WildFly Deployment Notes</h2> | |
| <p>See the <code>springbootdemo-wildfly</code> README (<code>modules/samples/userguide/src/userguide/springbootdemo-wildfly/README.md</code>) for the full deployment walkthrough. Key points (apply to both WildFly 32 and WildFly 41):</p> | |
| <ul> | |
| <li>WildFly 32.0.1.Final with <code>--add-modules=java.se</code> in <code>standalone.conf</code>, or WildFly 41.0.1.Final (deploys with the default configuration)</li> | |
| <li><code>jboss-deployment-structure.xml</code> from the sample's <code>WEB-INF</code> (includes the <code>jdk.net</code> module dependency)</li> | |
| <li><code>beans.xml</code> with <code>bean-discovery-mode="none"</code> (satisfies Weld without CDI scanning)</li> | |
| <li>Spring Boot 3.5.16 starts in ~1 second inside WildFly</li> | |
| <li>WAR: exploded <code>target/deploy/axis2-json-api/</code>, deployed as <code>axis2-json-api.war</code></li> | |
| </ul></section></section> </main> | |
| </div> | |
| </div> | |
| <hr/> | |
| <footer> | |
| <div class="container-fluid"> | |
| <div class="row-fluid"> | |
| <p>© 2004–2026 | |
| <a href="https://www.apache.org/">The Apache Software Foundation</a> | |
| </p> | |
| </div> | |
| </div> | |
| </footer> | |
| </body> | |
| </html> |