SOAP-to-REST Proxy with Authentication
A secure, standalone service that converts WSDL SOAP services into REST APIs with OpenAPI specifications. Designed to integrate with MCP Gateway for use with Claude Desktop.
- Username:
admin - Password:
Alekhya@123
β οΈ Important: Change these credentials in production by modifying the authentication logic inapp.py
- π Secure Authentication - Username/password login with session management
- π WSDL to OpenAPI Conversion - Automatic conversion of SOAP services to REST APIs
- π₯ Downloadable OpenAPI Specs - Export specs in YAML or JSON format
- π MCP Gateway Integration - Optional automatic registration with Claude MCP Gateway
- π§Ό Runtime SOAP Translation - Transparent REST β SOAP conversion at runtime
- πΎ PostgreSQL Storage - Persistent service registry with operation metadata
- π Web UI - User-friendly interface with checkbox for auto-registration
- π³ Railway Deployment - Ready to deploy with Dockerfile
- π API Key Support - Optional API key authentication for programmatic access
User uploads WSDL
β
SOAP Proxy converts to OpenAPI
β
Stores in PostgreSQL
β
[Optional] Auto-registers with MCP Gateway
β
Claude uses services via MCP
β
SOAP Proxy translates REST β SOAP at runtime
- Clone repository
cd soap-rest-proxy- Install dependencies
pip install -r requirements.txt- Set environment variables
cp .env.example .env
# Edit .env with your database URL and gateway credentials- Run application
python app.py- Open browser
http://localhost:8080
- Create new Railway project
- Add PostgreSQL database (Railway auto-configures
DATABASE_URL) - Set environment variables in Railway dashboard (see Configuration section below)
- Deploy from GitHub - Connect your repository
- Update
PROXY_BASE_URLwith your actual Railway app URL after first deployment - Redeploy - Railway will use the Dockerfile automatically
Configure these in Railway dashboard or .env file for local development:
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL |
β Yes | - | PostgreSQL connection string (auto-provided by Railway) |
PORT |
β Yes | 8080 |
Application port (auto-provided by Railway) |
PROXY_BASE_URL |
β Yes | http://localhost:8080 |
Must set to your Railway app URL (e.g., https://soap-proxy.up.railway.app) |
SECRET_KEY |
β Yes (prod) | dev-secret-key |
Flask session secret - generate random for production |
| Variable | Required | Default | Description |
|---|---|---|---|
GATEWAY_URL |
β Optional | Empty | MCP Gateway URL (can also configure via UI after login) |
GATEWAY_TOKEN |
β Optional | Empty | Gateway bearer token (can also configure via UI after login) |
API_KEY |
β Optional | Empty | If set, requires X-API-Key header for all API requests |
ZEEP_CACHE_TIMEOUT |
β Optional | 86400 |
WSDL cache timeout in seconds (24 hours) |
WSDL_REQUEST_TIMEOUT |
β Optional | 30 |
WSDL request timeout in seconds |
Minimal setup (required):
# Railway auto-provides these:
DATABASE_URL=postgresql://postgres:password@host:port/railway
PORT=8080
# You must set these:
PROXY_BASE_URL=https://your-app-name.up.railway.app
SECRET_KEY=generate-a-random-secret-key-hereWith Gateway integration (optional):
# In addition to the above:
GATEWAY_URL=http://gateway:4444
GATEWAY_TOKEN=your-bearer-token-without-Bearer-prefixGenerate a secure random secret key:
# Python
python -c "import secrets; print(secrets.token_urlsafe(32))"
# OpenSSL
openssl rand -base64 32Instead of setting GATEWAY_URL and GATEWAY_TOKEN as environment variables, users can configure them through the web UI after logging in:
- Login to SOAP-Proxy
- Click "βοΈ Gateway Configuration"
- Enter Gateway URL and Bearer Token
- Click "πΎ Save Configuration"
This configuration is stored in the user session and persists during the browser session.
Via Web UI:
- Navigate to http://your-app.railway.app
- Upload WSDL file or provide URL
- Check "Automatically register with MCP Gateway" (if configured)
- Click "Convert & Register"
Result:
- OpenAPI spec generated and stored
- Service operations registered
- (Optional) Automatically registered with Gateway
- Click "Download OpenAPI (YAML)" or "Download OpenAPI (JSON)"
- Use spec with existing OpenAPI tools or register manually
Runtime endpoint:
POST /soap/{service_name}/{operation_name}
Content-Type: application/json
{
"param1": "value1",
"param2": "value2"
}
Example:
curl -X POST http://your-app.railway.app/soap/WeatherService/GetWeather \
-H "Content-Type: application/json" \
-d '{"city": "San Francisco", "country": "US"}'If auto-registered with Gateway, add MCP endpoint to Claude Desktop config:
{
"mcpServers": {
"weather-service": {
"url": "http://gateway:4444/servers/abc-123/mcp",
"headers": {
"Authorization": "Bearer your-token"
}
}
}
}| Endpoint | Method | Description |
|---|---|---|
/api/convert |
POST | Upload WSDL and convert to OpenAPI |
/api/services |
GET | List all registered services |
/api/services/{id} |
GET | Get service details |
/api/services/{id} |
DELETE | Delete service |
/api/services/{id}/openapi.yaml |
GET | Download OpenAPI (YAML) |
/api/services/{id}/openapi.json |
GET | Download OpenAPI (JSON) |
/api/services/{id}/register-gateway |
POST | Manually register with Gateway |
/api/services/{id}/unregister-gateway |
DELETE | Unregister from Gateway |
| Endpoint | Method | Description |
|---|---|---|
/soap/{service}/{operation} |
POST | Execute SOAP operation via REST |
/health |
GET | Health check + DB status |
id- UUID primary keyname- Service name (unique)wsdl_url- Original WSDL URLdescription- Service descriptionopenapi_spec- Generated OpenAPI spec (JSONB)gateway_registered- Gateway registration statusgateway_server_uuid- Gateway server UUIDgateway_mcp_endpoint- MCP endpoint URLgateway_registered_at- Registration timestamp
id- UUID primary keyservice_id- Foreign key to servicesname- Operation namesoap_action- SOAP action headerinput_schema- JSON schema for input (JSONB)output_schema- JSON schema for output (JSONB)gateway_tool_id- Gateway tool ID
# Database (required)
DATABASE_URL=postgresql://user:pass@host:port/database
# Application
PORT=8080
PROXY_BASE_URL=https://your-app.railway.app
# MCP Gateway (optional - for auto-registration)
GATEWAY_URL=http://gateway:4444
GATEWAY_TOKEN=your-bearer-token
# Zeep Configuration
ZEEP_CACHE_TIMEOUT=86400 # 24 hours
WSDL_REQUEST_TIMEOUT=30 # 30 secondsWSDL URL:
http://www.dneonline.com/calculator.asmx?wsdl
openapi: 3.0.0
info:
title: Calculator
version: 1.0.0
paths:
/soap/Calculator/Add:
post:
operationId: Add
requestBody:
content:
application/json:
schema:
type: object
properties:
intA:
type: integer
intB:
type: integercurl -X POST http://your-app.railway.app/soap/Calculator/Add \
-H "Content-Type: application/json" \
-d '{"intA": 5, "intB": 3}'
# Response:
{"AddResult": 8}Check DATABASE_URL environment variable and PostgreSQL connectivity:
curl http://your-app.railway.app/health- Ensure WSDL URL is publicly accessible
- Check WSDL is valid XML
- Verify SOAP version (1.1 or 1.2)
- Verify GATEWAY_URL and GATEWAY_TOKEN are set
- Check Gateway is running and accessible
- Review Gateway logs for errors
- Verify parameters match input schema
- Check SOAP service is accessible
- Review application logs
# Install test dependencies
pip install pytest pytest-cov
# Run tests
pytestsoap-rest-proxy/
βββ app.py # Flask application
βββ config.py # Configuration
βββ database.py # PostgreSQL models
βββ wsdl_converter.py # WSDL β OpenAPI
βββ gateway_client.py # MCP Gateway integration
βββ soap_translator.py # Runtime REST β SOAP
βββ templates/ # Web UI templates
βββ static/ # CSS/JS assets
βββ Dockerfile # Railway deployment
MIT
Pull requests welcome! Please ensure:
- Code follows PEP 8
- Tests pass
- Documentation updated
For issues or questions:
- Create GitHub issue
- Check logs:
docker logs <container-id> - Review Railway deployment logs
Built with:
- Python 3.11
- Flask
- SQLAlchemy
- Zeep (SOAP client)
- PostgreSQL
- Railway (deployment)