title: Building SOAP request from WSDL
body: <p>I need to execute a SOAP request to an external server. I have never worked with SOAP before, but I know the basics of REST.
  I've been given this following <a href="https://sis-t.redsys.es:25443/apl02/services/SerClsWSConsulta/wsdl/SerClsWSConsulta.wsdl" rel="nofollow noreferrer">WSDL file</a> and this example query: </p>
  
  <pre><code>&lt;Messages&gt;
      &lt;Version Ds_Version="0.0"&gt;
          &lt;Message&gt;
              &lt;Detail&gt;
                  &lt;Ds_MerchantCode&gt;999008881&lt;/Ds_MerchantCode&gt;
                  &lt;Ds_Terminal&gt;1&lt;/Ds_Terminal&gt;
                  &lt;Ds_Order&gt;5799L&lt;/Ds_Order&gt;
                  &lt;Ds_TransactionType&gt;3&lt;/Ds_TransactionType&gt;
              &lt;/Detail&gt;
          &lt;/Message&gt;
      &lt;/Version&gt;
      &lt;Signature&gt;UfECD0KD9Wwo1iqY6PYZoJxw8KwMUz8m18bgLyH3BCI=&lt;/Signature&gt;
      &lt;SignatureVersion&gt;HMAC_SHA256_V1&lt;/SignatureVersion&gt;
  &lt;/Messages&gt;
  </code></pre>
  
  <p>I'm using Postman in order to test the API. Following some instructions I found on the internet, I added a <code>Content-Type</code> HTTP header with value <code>text/xml</code> and the <code>SOAPAction</code> HTTP header with value <code>consultaOperaciones</code> as found in the WSDL file.</p>
  
  <p>I've set this body:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;soap:Envelope
  xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
  soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"&gt;
      &lt;soap:Body xmlns:m="http://webservices.apl02.redsys.es"&gt;
          &lt;m:consultaOperacionesRequest&gt;
              &lt;Messages&gt;
                  &lt;Version Ds_Version="0.0"&gt;
                      &lt;Message&gt;
                          &lt;Transaction&gt;
                              &lt;Ds_MerchantCode&gt;999008881&lt;/Ds_MerchantCode&gt;
                              &lt;Ds_Terminal&gt;1&lt;/Ds_Terminal&gt;
                              &lt;Ds_Order&gt;5799L&lt;/Ds_Order&gt;
                              &lt;Ds_TransactionType&gt;3&lt;/Ds_TransactionType&gt;
                          &lt;/Transaction&gt;
                      &lt;/Message&gt;
                  &lt;/Version&gt;
                  &lt;Signature&gt;1KoxTgTakbTprzJ2N/e9JJ8yw/C3QzeNafbUMCNGSFM=&lt;/Signature&gt;
                  &lt;SignatureVersion&gt;HMAC_SHA256_V1&lt;/SignatureVersion&gt;
              &lt;/Messages&gt;
          &lt;/m:consultaOperacionesRequest&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>However, when I send the request I receive the following error message:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
      &lt;soapenv:Header/&gt;
      &lt;soapenv:Body&gt;
          &lt;soapenv:Fault&gt;
              &lt;faultcode&gt;Server&lt;/faultcode&gt;
              &lt;faultstring&gt;Internal Error&lt;/faultstring&gt;
          &lt;/soapenv:Fault&gt;
      &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>It's a generic SOAP error message, therefore I think that the problem has to be related to the codification instead of the external service.</p>
  
  <p>Thanks in advance. </p>