Get the countries WSDL or usage information
GET
https://api.testingapis.com/api/soap/countriesGet the countries WSDL (with ?wsdl) or usage information.
GET /api/soap/countries?wsdl returns a WSDL 1.1 document with SOAP 1.1 and 1.2 bindings. Without ?wsdl you get JSON listing the operations, the available country codes and a sample envelope.
Responses
- 200
- WSDL (text/xml) or usage JSON.
Example
Request
curl -X GET "https://api.testingapis.com/api/soap/countries"Response200 OK
{
"service": "Countries",
"wsdl": "https://api.testingapis.com/api/soap/countries?wsdl",
"namespace": "http://example.com/countries",
"operations": ["GetCountryInfo(countryCode)", "ListCountries()"],
"codes": ["US", "GB", "… 8 more items"],
"sample": <soap:Envelope xmlns:soap=\http://schemas.xmlsoap.org/soap/envelope/\><soap:Body><GetCountryInfo xmlns=\http://example.com/countries\…
}Code examples
JavaScript (fetch)
const response = await fetch("https://api.testingapis.com/api/soap/countries");
console.log(response.status, await response.text());Python (requests)
import requests
response = requests.request(
"GET",
"https://api.testingapis.com/api/soap/countries",
allow_redirects=False,
)
print(response.status_code, response.text)Java (HttpClient)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newBuilder()
.followRedirects(HttpClient.Redirect.NEVER)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.testingapis.com/api/soap/countries"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}