title: How can I send a SOAP request and receive a response using HTML?
body: <p>I would like to send a number to a <b>SOAP</b> "server"(I don't know if I can call it a server, correct me if I'm wrong) and receive a response using <b>HTML</b>, I've seen many questions with answers containing examples of sending an XML request such as below, but I have no idea on how to receive and see a response on <b>HTML</b>, sorry I'm new to <b>SOAP</b>.</p>
  
  <p>P.S.: Of course, by HTML I meant JavaScript within the HTML :P</p>
  
  <p><p><Br>Server: <a href="http://192.168.0.251:9080/wsa/wsa1/wsdl?targetURI=urn:services-progress-com:sys:server" rel="nofollow">Here</a>
  <p>Thanks in Advance!
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;SOAP JavaScript Client Test&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          function soap() {
              var xmlhttp = new XMLHttpRequest();
              xmlhttp.open('POST', 'http://192.168.0.251:9080/wsa/wsa1', true);
  
              // build SOAP request
              var sr =
                  '&lt;?xml version="1.0" encoding="utf-8"?&gt;' +
                  '&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:services-progress-com:notavailable"&gt;' +
                  '&lt;soapenv:Header/&gt;' +
                  '&lt;soapenv:Body&gt;' +
                  '&lt;urn:lnestagio&gt;' +
                  '&lt;urn:vvalor&gt;5&lt;/urn:vvalor&gt;' +
                  '&lt;/urn:lnestagio&gt;' +
                  '&lt;/soapenv:Body&gt;' +
                  '&lt;/soapenv:Envelope&gt;';
  
              xmlhttp.onreadystatechange = function() {
                      if (xmlhttp.readyState == 4) {
                          if (xmlhttp.status == 200) {
  
                              alert('done use firebug to see response');
                          }
                      }
                  }
                  // Send the POST request
              xmlhttp.setRequestHeader('Content-Type', 'text/xml');
              xmlhttp.send(sr);
              // send request
              // ...
          }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form name="Demo" action="" method="post"&gt;
          &lt;div&gt;
              &lt;input type="button" value="Soap" onclick="soap();" /&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><b>SOAP's XML from my server</b></p>
  
  <pre><code>    &lt;wsdl:definitions xmlns:tns="urn:services-progress-com:ys:server" xmlns:S2="urn:services-progress-com:sys:server:Estagio" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:prodata="urn:schemas-progress-com:xml-prodata:0001" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:S1="urn:soap-fault:details" xmlns="http://schemas.xmlsoap.org/wsdl/" name="Estagio" targetNamespace="urn:services-progress-com:sys:server"&gt;
  &lt;wsdl:documentation&gt;
  Author=sys, EncodingType=DOC_LITERAL, WSA_Product=10.2B07 - N/A
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:types&gt;
  &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="urn:soap-fault:details"&gt;
  &lt;element name="FaultDetail"&gt;
  &lt;complexType&gt;
  &lt;sequence&gt;
  &lt;element name="errorMessage" type="xsd:string"/&gt;
  &lt;element name="requestID" type="xsd:string"/&gt;
  &lt;/sequence&gt;
  &lt;/complexType&gt;
  &lt;/element&gt;
  &lt;/schema&gt;
  &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:services-progress-com:sys:server:Estagio"&gt;
  &lt;element name="lnestagio"&gt;
  &lt;complexType&gt;
  &lt;sequence&gt;
      &lt;element name="vvalor" nillable="true" type="xsd:decimal"/&gt; &lt;!-- Here I think he gets the number I sent --&gt;
  &lt;/sequence&gt;
  &lt;/complexType&gt;
  &lt;/element&gt;
  &lt;element name="lnestagioResponse"&gt;
  &lt;complexType&gt;
  &lt;sequence&gt;
  &lt;element name="result" nillable="true" type="xsd:string"/&gt;
  &lt;element name="vcalc" nillable="true" type="xsd:decimal"/&gt; &lt;!-- And it returns the number multiplied by 2 --&gt;
  &lt;/sequence&gt;
  &lt;/complexType&gt;
  &lt;/element&gt;
  &lt;/schema&gt;
  &lt;/wsdl:types&gt;
  &lt;wsdl:message name="FaultDetailMessage"&gt;
  &lt;wsdl:part name="FaultDetail" element="S1:FaultDetail"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="Estagio_lnestagio"&gt;
  &lt;wsdl:part name="parameters" element="S2:lnestagio"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="Estagio_lnestagioResponse"&gt;
  &lt;wsdl:part name="parameters" element="S2:lnestagioResponse"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:portType name="EstagioObj"&gt;
  &lt;wsdl:operation name="lnestagio"&gt;
  &lt;wsdl:input message="tns:Estagio_lnestagio"/&gt;
  &lt;wsdl:output message="tns:Estagio_lnestagioResponse"/&gt;
  &lt;wsdl:fault name="EstagioFault" message="tns:FaultDetailMessage"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:binding name="EstagioObj" type="tns:EstagioObj"&gt;
  &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  &lt;wsdl:operation name="lnestagio"&gt;
  &lt;soap:operation soapAction="" style="document"/&gt;
  &lt;wsdl:input&gt;
  &lt;soap:body use="literal"/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;soap:body use="literal"/&gt;
  &lt;/wsdl:output&gt;
  &lt;wsdl:fault name="EstagioFault"&gt;
  &lt;soap:fault name="EstagioFault" use="literal"/&gt;
  &lt;/wsdl:fault&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:service name="EstagioService"&gt;
  &lt;wsdl:port name="EstagioObj" binding="tns:EstagioObj"&gt;
  &lt;wsdl:documentation/&gt;
  &lt;soap:address location="http://localhost:9080/wsa/wsa1"/&gt;
  &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>