REST Services Home Page

WS Echo Service Documentation

Welcome to the WS Echo Service. This service is designed to receive a text message from you and send it back exactly as it was received. This type of service is often used to test connectivity and ensure that web requests are correctly handled.

Note for Beginners: This example shows how to make a request using both Burp Repeater (a popular testing tool) and the curl command (a command-line tool for making web requests). If you’re new to web services, don’t worry! Just follow along with the examples and you’ll get the hang of it quickly.

Endpoint

This is the address where the service is hosted:

POST /webservices/rest/ws-echo.php

How It Works

The Echo Service expects a single parameter called message in the request. It will return that same message in the response. This is useful to verify that your request was successfully received and processed.

Request Parameters

Step-by-Step Example Using Burp Repeater

Here’s how you can send a request to this service using Burp Repeater:

POST /webservices/rest/ws-echo.php HTTP/1.1
Host: mutillidae.localhost
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Origin: http://mutillidae.localhost
Connection: close
Content-Length: 20

message=Hello+World!

Instructions:

  1. Open Burp Suite and navigate to the Repeater tab.
  2. Copy the above request and paste it into the Repeater window.
  3. Click Send to see the response from the server.

Example Using curl (Command Line)

If you prefer using the command line, here’s how you can make the same request with curl:

curl -X POST "http://mutillidae.localhost/webservices/rest/ws-echo.php" \
 -H "Host: mutillidae.localhost" \
 -H "Accept: application/json" \
 -H "Origin: http://mutillidae.localhost" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 --data "message=Hello+World!"

Instructions:

  1. Open a terminal or command prompt.
  2. Copy and paste the above curl command.
  3. Press Enter to send the request and view the response.

Expected Response

If everything works correctly, you will receive a response like this:

{
    "message": "Hello World!",
    "command": "echo 'Hello World!'",
    "security-level": 0,
    "result": "Hello World!"
}
Troubleshooting Tips: If you encounter any issues:

Learn More

If you want to explore more, try modifying the message parameter and observe how the response changes. For example, send the message Hello from Class! and see if the service returns the same.