Hello,
I have browsed the forums for a solution on Zimbra not returning a <sessionId>. I am aware you have to pass the <session/> tag to retrieve a session but still am not able to get one.
This is the SOAP request and response:
Request:
POST
https://192.168.0.1:7071/service/admin/soap
SOAPAction: "https://192.168.0.1:7071/service/admin/soapAuthRequest"
Content-length: 397
Content-type: text/xml; charset="UTF-8"
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soap="urn:zimbraAccount" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Headers><context xmlns="urn:zimbra"><session/></context></soapenv:Headers>
<soapenv:Body>
<soap:AuthRequest>
<account by="name">user.name</account><password>mypassword</password></soap:AuthRequest>
</soapenv:Body>
</soapenv:Envelope>
Response:
date: Wed, 17 Nov 2010 08:00:17 GMT
status: 200
content-length: 536
content-type: text/xml; charset=utf-8
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><context xmlns="urn:zimbra"><change token="2249"/></context></soap:Header><soap:Body><AuthResponse xmlns="urn:zimbraAccount"><authToken>0_b97b4d7c2a8 62da28060c1f06a6ae58b24a10529_69643d33363a33346132 383637352d616561372d343530372d623939652d6362383833 353763343336383b6578703d31333a31323931313930343137 3936383b76763d313a353b747970653d363a7a696d6272613c </authToken><lifetime>1209600000</lifetime><skin>yahoo</skin></AuthResponse></soap:Body></soap:Envelope>
What i am able to do is authenticate as you can see in the response. I am also able to change the password via the following SOAP call:
POST
https://192.168.0.1:7071/service/admin/soap
SOAPAction: "https://192.168.0.1:7071/service/admin/soapChangePasswordRequest"
Content-length: 460
Content-type: text/xml; charset="UTF-8"
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soap="urn:zimbraAccount" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Headers><context xmlns="urn:zimbraAccount"><session/></context></soapenv:Headers>
<soapenv:Body>
<soap:ChangePasswordRequest>
<account by="name">user.name</account><oldPassword>oldpassword</oldPassword><password>newpassword</password></soap:ChangePasswordRequest>
</soapenv:Body>
</soapenv:Envelope>
I need (do i?) the session id to create calendar appointments via SOAP calls. Now when retrieving only the authtoken and passing it to the createappointment call give me this:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soap="urn:zimbraMail" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Headers/>
<soapenv:Body>
<soap:CreateAppointmentRequest>
<m d="1289988536" flags="u">
<e a="email@email.com"/>
<inv allday="0" fb="B" method="REQUEST" name="test" status="CONF" transp="O" type="event">
<s d="20101117T020000"/>
<e d="20101117T023000"/>
<at a="email@email.com" ptst="NE" role="REQ" rsvp="1"/>
<or a="email@email.com"/>
</inv>
</m></soap:CreateAppointmentRequest>
</soapenv:Body>
</soapenv:Envelope>
service.AUTH_REQUIRED
no valid authtoken present
Which leads me to believe i need to pass the sessionId too but i dont have one. Or is something wrong with the namespace of the CreateAppointmentRequest? The documentation doesnt clearly point out what it should be.
Anyone willing to help me? Thank you.
Nigel