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:


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


And here is my php code:

$header =  new SoapHeader('', "sessionHeader", array("sessionid"=>$this->sessionid), false);


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

the sticking point is this bit:


needs to look like this:


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:…>