title: PHP Laravel: SoapClient Issue Fatal Error: call to a member function __soapCall() on null
body: <p>I'm working on a project using a SOAP interface to another server and am having some serious issues getting this to work. SOAP is not something I am very familiar with and I have been having a really tough time finding help for this anywhere. Even the people who developed the WSDL file have no ability to help me... </p>
  
  <p>I have a WSDL file - <a href="https://sdkdev.wagefiler.com/WageFilerWS/wagefiler.asmx?WSDL" rel="nofollow noreferrer">https://sdkdev.wagefiler.com/WageFilerWS/wagefiler.asmx?WSDL</a></p>
  
  <p>For starters, I need to be able to create an account. The code below works but returns an error of "-999" which is undefined according to the developers of the WSDL and the other server side. They told me to make sure I'm passing an instance of an AccountRequest Object... but nothing I do seems to help.</p>
  
  <p>This is my SoapController.php file. My route points to "demo". It literally returns an error -999.</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers;
  use Illuminate\Http\Request;
  use App\Http\Requests;
  use Artisaninweb\SoapWrapper\SoapWrapper;
  use Sentinel;
  use App\backendInformation;
  use SoapClient;
  use SoapHeader;
  use SoapParam;
  use SoapVar;
  
  class SoapController extends Controller
  {
  
  public function demo()
  {
  
      $WSDL = 'https://sdkdev.wagefiler.com/WageFilerWS/wagefiler.asmx?WSDL';
      $user = Sentinel::getUser();
      $backendInfo = backendInformation::where('user_id', $user['id'])-&gt;first();
      $b = new backendInformation();
      $b-&gt;user_id  = $user['id'];
      $b-&gt;username = $user['email'];
      $b-&gt;password = crypt($b['username'], '$5$rounds=5000$anexamplestringforsalt$');
      $b-&gt;customername = $user['first_name'] . ' ' . $user['last_name'];
      $b-&gt;useremail = $user['email'];
      $b-&gt;autoemail = $user['email'];
  
  
  
      $options = [
          'trace' =&gt; true,
          'cache_wsdl' =&gt; WSDL_CACHE_NONE
      ];
  
      $credentials = [
          'ClientID' =&gt; 'XXXX'
      ];
  
  
      $data = array(
          'sequence' =&gt; array(
              'UserID' =&gt; $user-&gt;nelco_user_id,
              'Password' =&gt; $user-&gt;nelco_password,
              'Email' =&gt; $b-&gt;useremail,
              'ClientId' =&gt; config('global.nelco_client_id'),
              'FName' =&gt; $user-&gt;first_name,
              'LName' =&gt; $user-&gt;last_name,
              'EIN' =&gt; $user-&gt;ein,
              'Addr1' =&gt; $user-&gt;addr1,
              'City' =&gt; $user-&gt;city,
              'State' =&gt; $user-&gt;state,
              'Zip' =&gt; $user-&gt;zip,
              'Phone' =&gt; $user-&gt;phone,
          ),
      );
  
      $client = new SoapClient($WSDL, $options); // null for non-wsdl mode
  
      $param = new SoapParam(new SoapVar($data, SOAP_ENC_OBJECT), 'AccountRequest');
  
      $client-&gt;__soapCall('AccountSetup',array($param));
  
      echo "&lt;pre&gt;";
      var_dump($client);
      echo "&lt;/pre&gt;";
  
  }
  }
  </code></pre>
  
  <p>The return value looks like this - </p>
  
  <pre><code>object(SoapClient)#267 (12) {
    ["trace"]=&gt;
    int(1)
    ["_stream_context"]=&gt;
    resource(8) of type (stream-context)
    ["_soap_version"]=&gt;
    int(1)
    ["sdl"]=&gt;
    resource(10) of type (SOAP SDL)
    ["__last_request"]=&gt;
    string(972) "
      UserIDbob@bob.comPassword$5$rounds=5000$anexamplestringf$ADNI5REUuQNRHFXv3tId        EhLg65jb4Jc0csmuI4ENQu6Emailbob@bob.comClientId8266FNameBobLNameMcBobbersonEI    N123123123Addr1123 Bobs PlaceCityBobvilleStateokZip73115Phone123-123-1234
  "
    ["httpsocket"]=&gt;
    resource(11) of type (stream)
    ["_use_proxy"]=&gt;
    int(0)
    ["httpurl"]=&gt;
    resource(12) of type (SOAP URL)
    ["__last_request_headers"]=&gt;
    string(259) "POST /WageFilerWS/wagefiler.asmx HTTP/1.1
  Host: sdkdev.wagefiler.com
  Connection: Keep-Alive
  User-Agent: PHP-SOAP/7.1.8-1ubuntu1
  Content-Type: text/xml; charset=utf-8
  SOAPAction: "http://localhost/WageFiler/WageFiler/AccountSetup"
  Content-Length: 972
  
  "
    ["__last_response_headers"]=&gt;
    string(330) "HTTP/1.1 200 OK
  Cache-Control: private, max-age=0
  Content-Type: text/xml; charset=utf-8
  Server: Microsoft-IIS/7.5
  X-AspNet-Version: 4.0.30319
  X-Powered-By: ASP.NET
  Date: Wed, 25 Oct 2017 20:37:54 GMT
  Content-Length: 382
  Set-Cookie: BIGipServerpool_sdkdev.wagefiler.com_443=3389265580.47873.0000;     path=/; Httponly; Secure
  "
    ["_cookies"]=&gt;
    array(1) {
      ["BIGipServerpool_sdkdev.wagefiler.com_443"]=&gt;
      array(3) {
        [0]=&gt;
        string(21) "3389265580.47873.0000"
        [1]=&gt;
        string(1) "/"
        [2]=&gt;
        string(20) "sdkdev.wagefiler.com"
      }
    }
    ["__last_response"]=&gt;
    string(382) "-999"
  }
  </code></pre>