All the SOAP API docs are in the /opt/zimbra/docs folder on your server.
If you can read and understand PHP you could take a look at
SourceForge project :- "Z-Push Zimbra Backend"
Z-Push Zimbra Backend
Look in zimbra.php, and in particular for function Logon.
You can see how the SOAP headers/messages are constructed, and how the authorization token and session ID are returned in the XML response. The code uses a parser to turn the XML into an array for easier handling. There is a function further down SoapRequest that actually issues the curl command.
Hope that helps a little.