How does XML relate to Web services and SOA?


Although many technologies can be used to implement Service Oriented Architecture (SOA), the most commonly used one is Web Services, which means using XML. SOAP and REST are the two most popular ways to implement Web services, both based on XML.
An example

For example, by sending this SOAP document as a Web request, a request can be made to a Google Web service. (As shown in Listing 2)
Listing 2. Make a request to the Google Web service by sending a SOAP document

<?xml version=’1.0′ encoding=’UTF-8′?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV=





<ns1:doGoogleSearch xmlns:ns1=”urn:GoogleSearch”



<key xsi:type=”xsd:string”>00000000000000000000000000000000</key>

<q xsi:type=”xsd:string”>death star trash compactor</q>

<start xsi:type=”xsd:int”>0</start>

<maxResults xsi:type=”xsd:int”>10</maxResults>

<filter xsi:type=”xsd:boolean”>true</filter>

<restrict xsi:type=”xsd:string”></restrict>

<safeSearch xsi:type=”xsd:boolean”>false</safeSearch>

<lr xsi:type=”xsd:string”></lr>

<ie xsi:type=”xsd:string”>latin1</ie>

<oe xsi:type=”xsd:string”>latin1</oe>




Here we can see SOAPEnvelopeIt is a standard format that Web service engines can understand. The content of this message (in this case, the doGoogle Search element) is recognized asPayloadIt consists of information to be processed by Web services.