TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Call a countries operation

POSThttps://api.testingapis.com/api/soap/countriesSign in to see this endpoint's URL

Call a countries operation: GetCountryInfo or ListCountries.

Namespace http://example.com/countries. For SOAP 1.1 the optional SOAPAction is "http://example.com/countries/GetCountryInfo". ```

<GetCountryInfo xmlns="http://example.com/countries"><countryCode>IN</countryCode></GetCountryInfo> </soap:Body> </soap:Envelope> ```ListCountries takes no arguments and returns the code and name of all 10 countries.

Request body

Optional. text/xml. SOAP 1.1 envelope for GetCountryInfo or ListCountries.

Example body
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetCountryInfo xmlns="http://example.com/countries"><countryCode>JP</countryCode></GetCountryInfo></soap:Body></soap:Envelope>

Responses

200
SOAP response envelope.
400
SOAP 1.2 Sender fault (e.g. unknown country code).
415
Content-Type is not text/xml or application/soap+xml.
500
SOAP 1.1 fault.

Example

Request
curl -X POST "https://api.testingapis.com/api/soap/countries" \
  -H "Content-Type: text/xml" \
  -d '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetCountryInfo xmlns="http://example.com/countries"><countryCode>JP</countryCode></GetCountryInfo></soap:Body></soap:Envelope>' \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetCountryInfoResponse xmlns="http://example.com/countries">
      <Country>
        <Code>JP</Code>
        <Name>Japan</Name>
        <Capital>Tokyo</Capital>
        <Currency>JPY</Currency>
        <PhoneCode>+81</PhoneCode>
        <Continent>Asia</Continent>
        <Population>124516650</Population>
      </Country>
    </GetCountryInfoResponse>
… (2 more lines)

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.