This is the correct soap request to create a new user

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken>authToken goes here</authToken>
</context>
</soap:Header>
<soap:Body>
<CreateAccountRequest xmlns=\"urn:zimbraAdmin\">
<name>test@mydomain.com</name>
<password>myverystrongpassword</password>
</CreateAccountRequest>
</soap:Body>
</soap:Envelope>

I got a php page that will create this except the conetxt section with the authToken. This is what I got so far but it doesnt work.

$soapHeader = new SoapHeader('urn:zimbra',
'context',
new Context(
array(
new SoapParam($authToken['authToken'], 'authToken'),
)));

$soapClient->__setSoapHeaders($soapHeader);


This gives me the following error...

Uncaught SoapFault exception: [soap:Client] no valid authtoken present

Does anyone know what the correct php syntax is to create the content section?


Thank you!