title: SoapClient connection to SoapServer
body: <p>I need to connect to a SOAP Server from php, I read a lot of documentation, examples  and tutorials, but I still cannot make authentication to my server. I have done the work below:</p>
  
  <pre><code> $agencyNumber = 7818619810;
      $fullTransmission = false;
      //$context = array('header' =&gt; 'Content-type: application/soap+xml; charset=utf-8');
      $params = array( 'agencyNumber'     =&gt; 7818619810, 'fullTransmission' =&gt; 0/*,$context*/);
  
      $client = new SoapClient("http://link/to/server?wsdl");
     $test =  $client-&gt;__getFunctions();
      var_dump($test );// returns the functions my supplier provides, as well __getTypes() gives a bunch of variable arrays ect..
      $response = $client-&gt;__soapCall('GetTransmissionTicket',array($params) );//line 16 which is mentioned on error print
      var_dump($response);
  </code></pre>
  
  <p>Even though I set <code>$context</code>, when I try to run, I get the error below: </p>
  
  <blockquote>
    <p>Fatal error: Uncaught SoapFault exception: [HTTP] Cannot process the
    message because the content type 'text/xml; charset=utf-8' was not the
    expected type 'application/soap+xml; charset=utf-8'. in
    C:\xampp\htdocs\xml\inc\connection_test.php:16 Stack trace: #0
    [internal function]: SoapClient->__doRequest('http://interfac...', '..//my-provider...', 1, 0) #1
    C:..path..test.php(16): SoapClient->__soapCall('GetTransmission...',
    Array) #2 {main} thrown in C:..path..test.php on line 16</p>
  </blockquote>
  
  <p>The remote method I'm trying to call is called <code>GetTransmissionTicket</code> which takes two parameters, <code>(int)agencyNumber</code> and <code>fullTransmission</code>(bool)..</p>
  
  <p>I want to emphasize that there are a lot of threads on this topic, some of which are really close to my question(<a href="https://stackoverflow.com/questions/11593623/how-to-make-a-php-soap-call-using-the-soapclient-class/11593827#11593827">1</a>, <a href="https://stackoverflow.com/questions/777346/calling-a-soap-method-with-php-for-a-specific-service">2</a>, <a href="https://stackoverflow.com/search?q=php+soapclient">3</a> and so on ..), but I really couldn't solve the problem. Please give a hand..
  Kind Regards..</p>