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

Tutorial

Learn SOAP and XML

SOAP web services still run much of the world's banking, insurance, travel and government software, and XML turns up in REST APIs, feeds and standards everywhere. Both look intimidating at first: angle brackets, prefixes, URLs in attributes, a contract file hundreds of lines long. Each part turns out to be simple once someone explains what it's for.

These lessons start from XML itself and build up to a full test suite for a SOAP service. Every request was sent to the API at https://api.testingapis.com, which has real SOAP 1.1 and 1.2 services, a WSDL and XML endpoints, and every response shown is what came back. The code is Java, using only the JDK and JUnit, and every request is also shown with curl. If HTTP is new to you, start with the API testing tutorial. Some endpoints need a free account; set your key in TESTINGAPIS_KEY and the example project sends it with every request.

Download the example project

soap-xml-examples.zipA Maven project with 52 tests, one class per lesson. Java 21 and Maven 3.9 or later. Unzip and run mvn test.

8 lessons3 levelsFree

Words you'll meet

14 terms

Each one is explained properly in its lesson. This list is for looking one up later.

TermMeaningExplained in
ElementA start tag, its content and an end tag: <name>Ana</name>Lesson 1
AttributeA name and quoted value inside a start tag: id="1"Lesson 1
Well-formedFollowing XML's own rules, so a parser can read the document at allLesson 1
NamespaceA URI that says which vocabulary an element belongs toLesson 2
PrefixA short local nickname for a namespace URI, such as soap:Lesson 2
EnvelopeThe root element of every SOAP message, holding an optional Header and a BodyLesson 3
SOAPActionThe SOAP 1.1 header naming the operation being calledLesson 3
WSDLThe XML document in which a SOAP service describes its operations, messages and addressLesson 4
BindingThe part of a WSDL that says how to call the service: SOAP version, style, actionsLesson 4
FaultSOAP's standard error element, with a code and a reasonLesson 5
XPathA language for selecting parts of an XML documentLesson 6
PredicateA condition in square brackets that filters an XPath stepLesson 6
XML SchemaA language for describing which elements, types and values a document may containLesson 7
Content negotiationChoosing a response format with the Accept headerLesson 8