Suds and Sharepoint, Again
by Kevin
Hello,
I recently started poking at Sharepoint with Suds again, and encountered a new problem. I'm not sure if its particular to Suds, but maybe someone can help point me in the right direction.
I'm trying to use the WebPartPages service, which I can retrieve from the WSDL without any problems. It's referred to as c_parts in the code below.
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.bindings.unmarshaller').setLevel(logging.DEBUG)
stor = c_parts.factory.create('Storage')
SomeWebPartProperties = c_parts.service.GetWebPartProperties('http://somewhere/something.aspx',stor.Shared)
At this point I get:
DEBUG:suds.bindings.unmarshaller:reset
WARNING:suds.bindings.unmarshaller:attribute (ID) type, not-found
WARNING:suds.bindings.unmarshaller:attribute (ID) type, not-found
WARNING:suds.bindings.unmarshaller:attribute (ID) type, not-found
Nonetheless, SomeWebPartProperties contains useful, useable data. In particular, what I assume is the complete content of a particular Web Part is found at SomeWebPartProperties.WebParts.WebPart[0].
The problem comes when I use:
SomeWebPart = SomeWebPartProperties.WebParts.WebPart[0]
c_parts.service.AddWebPart('http://somewhere/else.aspx',SomeWebPart,stor.Shared)
This results in a very long error message that ends in
File "C:\Python25\lib\site-packages\suds\bindings\marshaller.py", line 545, in start
TypeNotFound: Type not found: '_ID'
This is rather confusing, as line 545 of marshaller.py doesn't seem to be in Literal.start. The documentation at http://msdn.microsoft.com/en-us/library/ms774670.aspx suggests that the XML object doesn't even need to have ID or _ID properties, but deleteing them (i.e. "del(SomeWebPart.ID)" ) and attempting to use AddWebPart again results in errors like
File "C:\Python25\lib\site-packages\suds\sudsobject.py", line 78, in footprint
AttributeError: WebPart instance has no attribute 'ID'
Any ideas what the problem is here? I was thinking that perhaps the GUID type is defined in a different namespace, but I'm not sure which one or even what to do with that namespace if I find it.
-Kevin
__________________________________________________________________
Connect with friends from any web browser - no download required. Try the new Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php
14 years, 10 months
Problem with WSDL and 0.3.6 version
by Rudi Alberda
Hey guys
I'm having a problem when upgrading to the 0.3.6 version of suds. I used
0.3.4 before and the issue didn't happen then. It seems to be a problem
with parsing the WSDL, but as far as I can tell there is nothing wrong
with it (I think it's generated by the apache CFX framework).
Can anyone provide me with some insight into what's going wrong? I've
tried using the schema doctor as mentioned in the Tips&Tricks section,
but to no avail.
Here's what happens:
>>> from suds.client import Client
>>> client =
Client('https://webservices.gids2.nl/GidsV2Core/zoekservice?wsdl')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/client.py",
line 106, in __init__
self.wsdl = Definitions(url, options)
File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
line 191, in __init__
self.open_imports()
File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
line 237, in open_imports
imp.load(self)
File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
line 341, in load
d = Definitions(url, definitions.options)
File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
line 194, in __init__
self.set_wrapped()
File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
line 303, in set_wrapped
resolved = pt.resolve()
File
"/home/rual/workspace_drenthe/python-suds-0.3.6/suds/xsd/sxbasic.py",
line 156, in resolve
raise TypeNotFound(qref)
suds.TypeNotFound: Type not found: '(GidsException,
http://exceptions.core.gids.nl, )'
--
----------------------------------------------------------------------
Rudi Alberda Knowlogy
rudi.alberda(a)knowlogy.nl Helperpark 290 C, 9723 ZA Groningen
Tel. +31 6 44168743 www.knowlogy.nl
----------------------------------------------------------------------
14 years, 10 months