title: Adding attributes to the actual function tag in PHP soapCall
body: <p>I need to add attributes to the tag representing the function/method in a call to a soap interface (specifically, a zimbra interface). </p>
  
  <p>I understand how attributes are added to <em>parameter</em> tags, but not to the actual method tag.</p>
  
  <p>For example, to add them to parameters, one might do something like: </p>
  
  <pre><code>    $var = new SoapVar('&lt;account by="name"&gt;' . $account . '&lt;/account&gt;', XSD_ANYXML);
      $params = array(new SoapParam($var, 'account'));
  
      try {
          $result = $this-&gt;SoapClient-&gt;__soapCall(
              "GetAccountInfoRequest", $params, null, $header
          );
      } catch (SoapFault $fault) {
          return false;
      } 
  </code></pre>
  
  <p>Which will generate the following expected XML:</p>
  
  <pre><code>&lt;body&gt;
      &lt;GetAccountInfoRequest&gt;
          &lt;account by="name"&gt;*someAccountName*&lt;/account&gt;
      &lt;/GetAccountInfoRequest&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>But what happens when one need to add attributes to the actual method tag, such as in the <a href="http://files.zimbra.com/docs/soap_api/8.0/soapapi-zimbra-doc/api-reference/zimbraAdmin/SetPassword.html" rel="nofollow">Zimbra setPasswordRequest</a>.</p>
  
  <p>That request is expecting XML not unlike the following:</p>
  
  <pre><code>&lt;body&gt;
      &lt;SetPasswordRequest id="someAccountId" newPassword="s3cr3tP@ss" /&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Which is simply the tag representing the method with attributes and 0 parameters.</p>
  
  <p>I've tried the following (to no avail):</p>
  
  <pre><code>    $var = new SoapVar('&lt;SetPasswordRequest id="'.$accountInfo-&gt;id
          .' newPassword="'.$newPass.'"/&gt;', XSD_ANYXML);
      $params = array(new SoapParam($var, 'SetPasswordRequest'));
  
      try {
          $result = $this-&gt;SoapClient-&gt;__soapCall(
              "SetPasswordRequest", $params, null, $header
          );
      } catch (SoapFault $fault) {
          return false;
      }
  </code></pre>
  
  <p>Which, much to my chagrin, created a nested tag like the following:</p>
  
  <pre><code>&lt;body&gt;
      &lt;ns1:SetPasswordRequest&gt;
          &lt;SetPasswordRequest id="5329ee70-fb5b-4fa1-a6cb-4c5a3f7f8a91 newPassword="DpJsPX3w?"/&gt;
      &lt;/ns1:SetPasswordRequest&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Currently, I'm serializing the soap XML manually for requests like this, and sending it with curl, but there must be a way to do this with SoapClient, I'm worried about code readability and portability for future developers on this, I don't want someone to have to learn to use my own iteration of a SOAP serializer just to be able to send requests.</p>