title: Calling soap function with parameters in PHP
body: <p>I'm new to soap and I have this task where I need to send request and receive response. However I get soap fault exception stating missing or invalid parameters. I've been looking at the solution for hours but none have worked for me.</p>
  
  <p>I know my parameters aren't working but I am unaware of how to send them. I've wrapper them in an array as few solutions stated that but it hasn't worked for me. </p>
  
  <p>I would really appreciate if you could look at my situation and help me solve understand the situation.</p>
  
  <p>If I connect with SOAP using SoapClient, and get functions and types I get the following:</p>
  
  <p>SOAP FUNCTIONS:</p>
  
  <pre><code>array (
          [0] =&gt; agentBalanceResult getAgentBalance(authorizationData $requesterAuthentication, agentIdentifier $targetAgent, string $productId,   string $requestTag)
  )
  
  &lt;?php
  </code></pre>
  
  <p>SOAP TYPES:</p>
  
  <pre><code>Array
  (
  [0] =&gt; struct authorizationData {
                aliasCategory aliasCategory;
                string aliasName;
                string aliasPassword;
                long mvnoId;
         }
  
  [1] =&gt; struct agentIdentifier {
                long actorId;
                aliasCategory aliasCategory;
                string aliasName;
                long mvnoId;
         }
  )
  </code></pre>
  
  <p>My Class that sends the request</p>
  
  <pre><code>class SendRequest {
  
  private $client;
  
  public function __construct(){
  
      $this-&gt;client = new SoapClient(
                                      "myurl",
                                      [
                                          'location' =&gt; 'myurl'
                                      ]
                      );
  
  }
  
  public function sendRequestWithData(){
  
      //test parameters
      $testParameters = [
  
          "authorizationData" =&gt; [
              "aliasCategory" =&gt; "*****",
              "aliasName" =&gt; "*****",
              "aliasPassword" =&gt; "*****",
              "mvnoId" =&gt; "*****"
          ],
  
          "agentIdentifier" =&gt; [
              "actorId" =&gt; *****,
              "aliasName" =&gt; "*****",
              "aliasCategory" =&gt; "*****",
              "mvnoId" =&gt; "*****"
          ],
  
          "productId" =&gt; "*****",
          "requestTag" =&gt; "*****"
  
      ];
  
      $this-&gt;client-&gt;getAgentBalance($testParameters);
  
  }
  
  }
  
  $send = new SendRequest;
  $send-&gt;sendRequestWithData();
  
  // throws Uncaught SoapFault exception: [env:Server] Missing or invalid SOAP request parameters in
  </code></pre>