[Fedora-suds-list] Microsoft Exchange EWS module

Erik Cederstrand erik at cederstrand.dk
Fri Jul 23 07:49:13 UTC 2010


Hi Jared,

Den 23/07/2010 kl. 09.22 skrev Jared Eckersley:

> I was able to manually remove the python-ntlm library and reinstall and got
> it working again.

Great. Could you try my script again and see if it works for you?

> createitem = Element('CreateItem')
[...]
> attr = c.service.CreateItem(createitem)

CreateItem() takes as arguments the elements within createitem, i.e. 'saveditemfolderid' and 'items'. You shouldn't create the 'createitem' element. If you look at your XML, you have the CreateItem tag twice:

>         <ns1:CreateItem>
>            <CreateItem MessageDisposition="SendAndSaveCopy"
> xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">


Your namespace usage is also funky. You need to clean that up if you get more 'Invalid request' messages.

Finally, you can't use the factory methods, since CreateItem expects the attribute MessageDisposition, and Suds doesn't support that without the patch in ticket #21. Generate the full XML instead (including headers) and inject it:

c.service.CreateItem(__inject={'msg':xml})

Thanks,
Erik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1928 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/suds/attachments/20100723/ba8d39d6/attachment.bin 


More information about the suds mailing list