title: PHP Soap making use of login info for methods
body: <p>So I'm new to using SOAP and I'm a bit stuck on getting my user logins through the request so I can run/access the method.</p>
  <p>Below you can see the code I'm trying to execute to get this running.</p>
  <pre><code>$options = array(
      'cache_wsdl'     =&gt; 0,
      'trace'          =&gt; 1,
      'stream_context' =&gt; stream_context_create(
          array(
              'ssl' =&gt; array(
                  'verify_peer'       =&gt; false,
                  'verify_peer_name'  =&gt; false,
                  'allow_self_signed' =&gt; true,
              ),
          )
      ),
  );
  
  $user = 'MindesExdevFeedUser';
  $password = 'MindesExdevFeedUser';
  $url = 'https://exdev.server.propctrl.com/v5.4/Basic/AgencyIntegration.svc?wsdl';
  $client = new SoapClient($url, $options);
  
  try {
      echo &quot;trying to login\n&quot;;
      $functions = $client-&gt;__getFunctions ();
      echo '&lt;pre&gt;' . var_export($functions, true) . '&lt;/pre&gt;'; 
      $session_id = $client-&gt;Credentials( $user, $password );
      echo &quot;logged in\n&quot;;
      
      $result = $client-&gt;FetchNewListingIds( $session_id );
      
      var_dump( $result );
      
  } catch (Exception $e) {
      var_dump( $e-&gt;getMessage() );
  }
  </code></pre>
  <p>I'm getting this error: <strong>string(63) &quot;Function (&quot;Credentials&quot;) is not a valid method for this service&quot;</strong></p>
  <p>I've put in the above url into SoapUI which then gives me all the methods. If I open up the FetchNewListingIds method I get this:</p>
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:v5=&quot;http://server.propctrl.com/v5_4&quot; xmlns:ais=&quot;http://server.propctrl.com/v5_4/AIS&quot;&gt;
     &lt;soapenv:Header&gt;
        &lt;v5:Credentials&gt;
           &lt;!--Optional:--&gt;
           &lt;v5:Password&gt;?&lt;/v5:Password&gt;
           &lt;!--Optional:--&gt;
           &lt;v5:Username&gt;?&lt;/v5:Username&gt;
        &lt;/v5:Credentials&gt;
     &lt;/soapenv:Header&gt;
     &lt;soapenv:Body&gt;
        &lt;ais:FetchNewListingIds/&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  <p>As you can see I need to add in a Username and Password then I can run that method and get the data back.</p>
  <p>How would I do this with my PHP code?</p>