Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-2009, 01:23 AM
Starter Member
 
Posts: 2
Default XML problems

Hi all, newbie to this so be gentle.
Im using python and trying to do some simple things with zimbra soap

heres my first post
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<userAgent xmlns="" name="Jimmy code" version="1"></userAgent>
<sessionId xmlns="" id=""></sessionId>
<account xmlns="" by="name">test1@test-zimbra.uk.corpdata</account>
<authToken xmlns="">

</authToken>
</context>
</soap:Header>
<soap:Body>
<AuthRequest xmlns="urn:zimbraAccount">
<account by="name">test1@test-zimbra.uk.corpdata</account>
<password>thepassword</password>
</AuthRequest></soap:Body>
</soap:Envelope>

this seems to work fine and i get the sessionId and authtoken from response to this

then when i post this
soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<userAgent xmlns="" name="Jimmy code" version="1"></userAgent>
<sessionId xmlns="" id="197">197</sessionId>
<account xmlns="" by="name">test1@test-zimbra.uk.corpdata</account>
<authToken xmlns="">
0_8c658488c28dee14e1d488f0b0080b5afabc28d4_69643d3 3363a66303831346133342d356330372d343663642d6263313 52d3731323736323339336135343b6578703d31333a3132363 03030323539353038363b747970653d363a7a696d6272613b
</authToken>
</context>
</soap:Header>
<soap:Body><NoOpRequest></NoOpRequest></soap:Body>
</soap:Envelope>

the mailbox.log says the the xml is formated incorrect or the xml must start and end within the same entity...I use the same function to create the xml
so there shouldnt be any difference...Having played with it, it seems the authToken string seems to break the XML but i cant work out how.

Any ideas folks?
also can i use http to do these requests or does it have to be https?
thanks
Jim
Reply With Quote
  #2 (permalink)  
Old 12-03-2009, 02:27 AM
Starter Member
 
Posts: 2
Default

i have tried using the minidom lib in python to check and tidy my xml
the XML now i have now is below, the message i get now is that the authtoken must have a closing </authtoken> which i have got...
any ideas?

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"><authToken>0_4ed64c87c3cfa7a057 731a34b4bf07360f7b4e24_69643d33363a663038313461333 42d356330372d343663642d626331352d37313237363233393 36135343b6578703d31333a313236303030383733303039363 b747970653d363a7a696d6272613b</authToken><sessionId id="1144">1144</sessionId></context></soap:Header><soap:Body><GetAccountRequest xmlns="urn:zimbraAdmin"><account by="name">admin@test-zimbra.uk.corpdata</account></GetAccountRequest></soap:Body></soap:Envelope>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.