Friday, December 19, 2014

Re: problem with using suds and sharepoint

Based on this:

<detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Item does not exist. It may have been deleted by another user.</errorstring></detail>

I'm guessing that listItemID number 2 doesn't exist, or the ID of the parent object isn't specified. I'm not familiar with the WSDL for SharePoint, but you are referencing an object that currently doesn't exist.

BTW, are you using the suds or suds-jurko version? I would highly recommend the Jurko version, the original is a bit crusty...should be almost a drop-in replacement.

https://bitbucket.org/jurko/suds

-James

On Dec 19, 2014 10:09 PM, "Hossein Rashnoo" <mhr1224@gmail.com> wrote:
I tried to add attachment to a sharepoint document library with this command:

result = client.service.AddAttachment("new doc","2","ab.ds","QUJDREVGR0hJSktMTU5PUA==")

but i got this error:

DEBUG:suds.client:sending to (http://portal:8080/rashno/_vti_bin/lists.asmx)
message:
<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Header/>
   <ns0:Body>
      <ns1:AddAttachment>
         <ns1:listName>new doc</ns1:listName>
         <ns1:listItemID>2</ns1:listItemID>
         <ns1:fileName>ab.ds</ns1:fileName>
         <ns1:attachment>QUJDREVGR0hJSktMTU5PUA==</ns1:attachment>
      </ns1:AddAttachment>
   </ns0:Body>
</SOAP-ENV:Envelope>
DEBUG:suds.client:headers = {'SOAPAction': u'"http://schemas.microsoft.com/sharepoint/soap/AddAttachment"', 'Content-Type': 'text/xml; charset=utf-8'}
DEBUG:suds.client:http succeeded:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Item does not exist. It may have been deleted by another user.</errorstring></detail></soap:Fault></soap:Body></soap:Envelope>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 542, in __call__
    return client.invoke(args, kwargs)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 602, in invoke
    result = self.send(soapenv)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 643, in send
    result = self.succeeded(binding, reply.message)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 678, in succeeded
    reply, result = binding.get_reply(self.method, reply)
  File "/usr/lib/python2.6/site-packages/suds/bindings/binding.py", line 151, in get_reply
    self.detect_fault(soapbody)
  File "/usr/lib/python2.6/site-packages/suds/bindings/binding.py", line 182, in detect_fault
    raise WebFault(p, fault)
suds.WebFault: Server raised fault: 'Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.'

please help me, tnx

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ff2f5235-24aa-4f72-a14b-0bb496b9c98d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWwmH2n%2BfQkNYqg2g%2BoE3aeci5jtS9dP1ZMF6WXKF5dvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment