Meant to CC the list on reply. Cameron, sorry for the dup.
-------- Original Message --------
Subject: Re: [Fedora-suds-list] Exception in unmarshaller
Date: Wed, 11 Jun 2008 11:18:26 -0400
From: Jeff Ortel <jortel(a)redhat.com>
To: Cameron Morrison <cameron.am(a)gmail.com>
References: <611cee900806110704o27715994v661fe4998629a680(a)mail.gmail.com>
Hey Cameron,
The GetRecordingsResponse is a tns:ServiceResponse:
<s:complexType name="ServiceResponse">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1"
name="status"
type="tns:Status" />
<s:element minOccurs="0" maxOccurs="1"
name="result">
<s:complexType>
<s:sequence>
<s:any processContents="lax" />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
which defines the content of <result/> to be a sequence of xs:any which
is not supported until 0.2.2 which I plan to commit to trunk sometime
this week (I hope) and release in a few weeks.
You may want to try an older version of suds. The unmarshaller has
gotten smarter over the past couple of releases. Id suggest trying the
0.1.7 which used a blind unmarhsaller for document/literal which didn't
perform any schema lookups. It should unmarshall anything ;-)
Please let me know how you make out.
Regards,
Jeff
Cameron Morrison wrote:
Hi,
I am trying to call the service GetRecordings(...) defined in the
attached wsdl, like so:
---
#!/bin/python
from suds.client import Client
from suds import *
logger('suds.serviceproxy').setLevel(logging.DEBUG)
client = Client('http://localhost:2048/services/Recording.asmx?WSDL',
faults=False, proxy={'http':'localhost:8888'})
print client.service.GetRecordings('FilterBySong', 'None', 1, 10,
'2')
---
The call works, and the following xml is returned:
---
<?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>
<GetRecordingsResponse
xmlns="http://tempuri.org/">
<GetRecordingsResult>
<status>Success</status>
<result>
<recordings count="4" total="4"
xmlns="">
<recording id="317879" Votes="0"
comments="0"
soundId="2">
<p1name><![CDATA[rob1]]></p1name>
<p2name><![CDATA[rob2]]></p2name>
<voice1Url>v1url</voice1Url>
<voice2Url>v2url</voice2Url>
</recording>
<recording id="317878" Votes="0"
comments="0"
soundId="2">
<p1name><![CDATA[cam1]]></p1name>
<p2name><![CDATA[cam2]]></p2name>
<voice1Url>v1url</voice1Url>
<voice2Url>v2url</voice2Url>
</recording>
<recording id="317877" Votes="0"
comments="0"
soundId="2">
<p1name><![CDATA[rob1]]></p1name>
<p2name><![CDATA[cam1]]></p2name>
<voice1Url>v1url</voice1Url>
<voice2Url>v2url</voice2Url>
</recording>
<recording id="317876" Votes="0"
comments="0"
soundId="2">
<p1name><![CDATA[Cam]]></p1name>
<p2name><![CDATA[Rob]]></p2name>
<voice1Url>Cams voice</voice1Url>
<voice2Url>Robs voice</voice2Url>
</recording>
</recordings>
</result>
</GetRecordingsResult>
</GetRecordingsResponse>
</soap:Body>
</soap:Envelope>
---
... but the unmarshaller is throwing an exception when trying to
process the recordings element of the returned document:
---
2008-06-11 09:41:58,250 {2796} (resolver.py, 167) [ERROR] (recordings) not-found
Traceback (most recent call last):
File "./test_driver.py", line 15, in <module>
print client.service.GetRecordings('FilterBySong', 'None', 1, 10,
'2')
File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 145,
in __call__
File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 258, in send
File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 305,
in succeeded
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/binding.py",
line 86, in get_reply
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/binding.py",
line 111, in unmarshal
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py",
line 73, in process
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py",
line 91, in __process
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py",
line 122, in import_children
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py",
line 91, in __process
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py",
line 122, in import_children
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py",
line 89, in __process
File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py",
line 275, in start
suds.TypeNotFound: WSDL type: recordings not-found
---
The "recordings" element is not specified in the WSDL - the Result
field of a ServiceResponse is intended to be arbitrarly formatted xml
- is there any way that Suds can handle this?
Cheers,
Cameron
ps. the service is internal, so I am unable to provide a test url, sorry!
------------------------------------------------------------------------
_______________________________________________
fedora-suds-list mailing list
fedora-suds-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/fedora-suds-list