Hi,
I am new to SUDS and web related technologies so, please, forgive me any silly statements ☺
Currently I am having problem with SUDS when trying to invoke some web service methods which are returning lists of elements. The problem appears only with methods returning list of elements of some type… other methods work perfectly fine.
For example, on server side there is a Java method declaration given as:
public final List<someType> getStoredReports()
when I try to invoke this method using SUDS client I got an exception that some object must be a qualified reference.
I searched the Internet first, but with no effect, so I decided to take a look on SUDS code. The exception is thrown from constructor of Query class:
class Query(Object):
"""
Schema query base class.
"""
def __init__(self, ref=None):
"""
@param ref: The schema reference being queried.
@type ref: qref
"""
Object.__init__(self)
self.id = objid(self)
self.ref = ref
self.history = []
self.resolved = False
if not isqref(self.ref):
raise Exception('%s, must be qref' % tostr(self.ref))
and inside this 'isqref()' function only the last part of return statement is messing up (isinstance(object[1], basestring)):
def isqref(object):
"""
Get whether the object is a I{qualified reference}.
@param object: An object to be tested.
@type object: I{any}
@rtype: boolean
@see: L{qualify}
"""
#print (tostr(object))
return (\
isinstance(object, tuple) and \
len(object) == 2 and \
isinstance(object[0], basestring) and \
isinstance(object[1], basestring))
I understand that while creating a Query object instance, some reference (ref) parameter is needed and it must be a pair/tuple of strings. While invoking a web service method returning list of elements this reference is something like ('someTypeName', null) and this is a problem.
What is also important when I comment out the peace of SUDS code checking for this 'qref' stuff, the invoked web service method seems to return a proper values -> it is in fact a list of elements of a given type.
Have you met such issue before? Is it some limitation of SUDS or maybe I am doing something wrong?
Thank you in advance for your help.
Regards
Bartek
Bartłomiej Gabryelski
Nokia Siemens Networks Sp. z o.o.
CEM N&SDM ITSM LIC
ul. Strzegomska 2-4
53-611 Wroclaw, Poland
phone: +48 784 031 675
e-mail: Bartlomiej.Gabryelski(a)nsn.com