SoapHeader->sessionHeader

Folks,

I’m struggling to append my sessionid in the SoapHeader, I’m close, but something is missing.
My SoapHeader needs to look like this in the request:


<soapenv:Header>
      <sil:sessionHeader>
         <sil:sessionid>?</sil:sessionid>
      </sil:sessionHeader>
   </soapenv:Header>

However, when I run my code I’m only able to generate the header like this:


<SOAP-ENV:Header>
<ns2:sessionHeader>
<item>
<key>sessionid</key>
<value>sdfsdf345345sdfsdf345345345B9</value>
</item>
</ns2:sessionHeader>
</SOAP-ENV:Header>

And here is my php code:


$header =  new SoapHeader('http://xxx.xxxxx.com/xxx?wsdl', "sessionHeader", array("sessionid"=>$this->sessionid), false);

        $this->soap_client->__setSoapHeaders(array($header));

Any ideas what I’m doing wrong or whats missing?

the sticking point is this bit:


<item>
<key>sessionid</key>
<value>sdfsdf345345sdfsdf345345345B9</value>
</item>

needs to look like this:


<ns:sessionid>sdfsdf345345sdfsdf345345345B9</ns:sessionid>

I have this now solved. I realized I was using the wrong name space in my SoapHeader() and second I used SoapVar() to pass in the exact format of my <ns:2sessionHeader> and <ns:2sessionid>balue</ns2:…></ns2:…>