Home  >  Article  >  Backend Development  >  Specifically introduce how XML is related to Web services and SOA?

Specifically introduce how XML is related to Web services and SOA?

黄舟
黄舟Original
2017-03-13 16:16:301632browse

Although many technologies can be used to implement a service-oriented architecture (SOA), the most common is to use Web services, which means using XML. SOAP and REST are the two most popular methods of implementing web services, both of which are based on XML. one example For example, by sending this SOAP document as a Web request, you can provide it to a Google Web service. Although many techniques can be used to implement service-oriented architecture (SOA), the most common is to use Web services, which means that Use XML. SOAP and REST are the two most popular methods of implementing web services, both of which are based on XML.

An exampleFor example, by sending this SOAP document as a web request, you can make a request to Google Web Services. (As shown in Listing 2)

Listing 2. Making a request to Google Web Services by sending a SOAP document
           

<?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?>

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

     "http://schemas.xmlsoap.org/soap/envelope/" 

   xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 

   xmlns:xsd="http://www.w3.org/1999/XMLSchema">

  <SOAP-ENV:Body>

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

         SOAP-ENV:encodingStyle=

                  "http://schemas.xmlsoap.org/soap/encoding/">

      <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>

    </ns1:doGoogleSearch>

  </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Here we can see the SOAP

Envelope, which is a standard format that the Web service engine can understand. The content of this message (in this case, the doGoogleSearch element) is considered the payload(payload), which consists of the information to be processed by the web service.                                                                                              

The above is the detailed content of Specifically introduce how XML is related to Web services and SOA?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn