title: SOAP: HTTP Bad Request
body: <p>I am getting below error after requesting SOAP call.</p>
  
  <blockquote>
    <p>fault code: HTTP, fault string: Bad Request</p>
  </blockquote>
  
  <p><strong>Is this badly formed message?</strong></p>
  
  <pre><code>try{
      $client = new SoapClient("http://ip_add/something.asmx?WSDL", array("trace" =&gt; true, 'exceptions' =&gt; 1));
  
      $params = new \SoapVar('&lt;?xml version="1.0" encoding="utf-8"?&gt;
                  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
                  &lt;soap:Body&gt;
                      &lt;RemittanceService xmlns="http://tempuri.org/"&gt;
                      &lt;CreditTxnMessage xmlns="http://my_url"&gt;
                      &lt;Corporate_UID xmlns=""&gt;66666&lt;/Corporate_UID&gt;
                      &lt;Mandate_Type xmlns=""&gt;P&lt;/Mandate_Type&gt;
                      &lt;MICR_No xsi:nil="true" xmlns="" /&gt;
                      &lt;Instrument_No xsi:nil="true" xmlns="" /&gt;
                      &lt;Remitter_Address1 xmlns=""&gt;285 enfiled pl&lt;/Remitter_Address1&gt;
                      &lt;Remitter_Address2 xmlns=""&gt;mississauga&lt;/Remitter_Address2&gt;
                      &lt;Remitter_Address3 xmlns=""&gt;16y2n4&lt;/Remitter_Address3&gt;
                      &lt;Remitter_Country xmlns=""&gt;Canada&lt;/Remitter_Country&gt;
                      &lt;Remitter_ZIP_Code xsi:nil="true" xmlns="" /&gt;
                      &lt;Remitter_EmailID xsi:nil="true" xmlns="" /&gt;
                      &lt;Remitter_Contact_No xmlns="" /&gt;
                      &lt;Beneficiary_ZIP_Code xsi:nil="true" xmlns="" /&gt;
                      &lt;Beneficiary_EmailID xsi:nil="true" xmlns="" /&gt;
                      &lt;Beneficiary_Contact_No xmlns="" /&gt;
                      &lt;Beneficiary_Bank_Name xmlns=""&gt;PNB&lt;/Beneficiary_Bank_Name&gt;
                      &lt;/CreditTxnMessage&gt;
                      &lt;/RemittanceService&gt;
                  &lt;/soap:Body&gt;
                  &lt;/soap:Envelope&gt;', XSD_ANYXML);
  
      $result = $client-&gt;__soapCall('RemittanceService', array($params));
      highlight_string($client-&gt;__getLastRequest());
  }
  catch(SoapFault $fault){
      die("SOAP Fault:&lt;br /&gt;fault code: {$fault-&gt;faultcode}, fault string: {$fault-&gt;faultstring}");
  }
  </code></pre>
  
  <p>I don't know what's wrong here.</p>
  
  <p><strong>Stack Trace</strong></p>
  
  <pre><code>SoapFault exception: [HTTP] Bad Request in /var/www/mtes/public_html/application/controllers/bank_api_pnb.php:146
  Stack trace:
  #0 [internal function]: SoapClient-&gt;__doRequest('&lt;?xml version="...', 'http://124.124....', 'http://tempuri....', 1, 0)
  #1 /var/www/mtes/public_html/application/controllers/bank_api_pnb.php(146): SoapClient-&gt;__soapCall('RemittanceServi...', Array)
  #2 [internal function]: Bank_api_pnb-&gt;test()
  #3 /var/www/mtes/public_html/system/core/CodeIgniter.php(359): call_user_func_array(Array, Array)
  #4 /var/www/mtes/public_html/index.php(220): require_once('/var/www/mtes/p...')
  #5 {main}
  </code></pre>