A simple SOAP web service that provides calculator operations (addition and subtraction) with both server and client implementations.
- Features
- Method 1: Using Docker
- Method 2: Direct Installation
- API Documentation
- Testing the Service
- Troubleshooting
- SOAP-based web service
- Calculator operations (add, subtract)
- Interactive client with command-line interface
- Docker support for easy deployment
- Detailed logging of operations
- Docker installed on your system
- Docker Desktop (for Windows/Mac users)
- Pull the image:
docker pull adityaindoc/soap-calculator:latest- Run the server:
docker run -p 8000:8000 adityaindoc/soap-calculator:latestThe service will be available at:
- SOAP endpoint: http://localhost:8000/calculator
- WSDL: http://localhost:8000/calculator?wsdl
- Create a docker-compose.yml:
services:
soap-calculator:
image: yourusername/soap-calculator:latest
ports:
- "8000:8000"
environment:
- NODE_ENV=production
restart: unless-stopped- Run with docker-compose:
docker-compose up- Node.js (v16 or higher)
- npm (comes with Node.js)
- Clone the repository:
git clone https://github.com/adityainhub/wsdl_program.git
cd wsdl_program- Install dependencies:
npm install- Start the server:
node server.jsThe service will be available at:
- SOAP endpoint: http://localhost:8000/calculator
- WSDL: http://localhost:8000/calculator?wsdl
- In a new terminal, run the client:
node client.jsThe client provides a menu-driven interface:
- Choose operation (1: Add, 2: Subtract, 3: Exit)
- Enter first number
- Enter second number
- View result
-
"Container not starting":
- Check Docker Desktop is running
- Verify port 8000 is not in use
docker logs [container_id]
-
"Cannot connect to service":
- Ensure correct port mapping
- Check firewall settings
-
"Module not found":
npm install
-
"Port already in use":
- Change port in server.js
- Or stop the process using port 8000
- Restart Docker/Node.js
- Check logs:
docker logs [container_id] - Verify WSDL availability: http://localhost:8000/calculator?wsdl