Re: [Fedora-suds-list] Type not found: '(Array, ..)' on many independent web services
by Jeff Ortel
Matt,
The factory.create() method takes a (.) separated path. The path is used to reference
elements nested elements such as:
<element name="A">
<element name="B"/>
<element name="C"/>
</element>
</element>
Element 'C' is not a top level element so the only way to create one is using the
following path:
>
> client.factory.create('A.B.C')
>
But, to handle names containing (.), I'll need to add an optional param (maybe:
pathseparator) to create(). I'll CC you on the ticket so you'll get an email when it's
committted.
Regards,
Jeff
Matt C wrote:
> It looks like I'm working, at least for the getter methods. I'm flailing
> now with figuring out how to deal with my types correctly...I suspect
> that the types defined with dots "." in them may cause me grief:
>
> Calling the create() method expects the following types:
> create(Common.StringSequence pool_names, LocalLB.LBMethodSequence
> lb_methods, Common.IPPortDefinitionSequenceSequence members, )
>
> In [198]: mem = c.factory.create('Common.IPPortDefinition')
> DEBUG:suds.resolver:searching schema for (Common)
> DEBUG:suds.xsd.query:('Common', u'urn:iControl'), not-found
> DEBUG:suds.xsd.query:('Common', u'urn:iControl'), not-found
> ERROR:suds.resolver:(Common) not-found
> ERROR:suds.resolver:path: "Common.IPPortDefinition", not-found
>
> Any suggestions? Once I figure out how to deal with these types
> correctly (with fingers crossed that Suds is OK with the Soap-Enc:
> Arrays defined in the WSDL) I think we may be off to the races.
>
> Regards,
> Matt
>
>
>
> On Thu, Feb 26, 2009 at 3:47 PM, Matt C <mcauthorn(a)gmail.com
> <mailto:mcauthorn@gmail.com>> wrote:
>
> Jeff: Many thanks. I'll look into getting the WSDL changed. In the
> meantime I'm eager to start working with the library - thanks for
> the work!
>
> Regards,
> Matt
>
>
> On Wed, Feb 25, 2009 at 2:45 PM, Jeff Ortel <jortel(a)redhat.com
> <mailto:jortel@redhat.com>> wrote:
>
> Hey Matt,
>
> Found the problem. The Import.bind() isn't helping because the
> WSDL is broken in a different way. It is referencing the
> 'Array' type defined in the schema for the soap section 5
> encoding namespace ( http://schemas.xmlsoap.org/soap/encoding/ )
> but does *not* import it.
>
> Properly importing the namespace by adding:
> <xsd:import
> namespace='http://schemas.xmlsoap.org/soap/encoding/'/
> <http://schemas.xmlsoap.org/soap/encoding/%27/>>
> at line #24 in the WSDL fixes the WSDL. (see attached).
>
> As mentioned, 0.3.4 automatically binds the
> 'http://schemas.xmlsoap.org/soap/encoding/' namespace to the
> schemaLocation="http://schemas.xmlsoap.org/soap/encoding/". So,
> if you're using suds 0.3.4+, you no longer need to manually bind
> the namespace.
>
> Hope this helps,
>
> Jeff
>
>
> Matt C wrote:
>
> For some reason I simply can't get past this error. I am
> running 0.3.3 and I've tried all of the manual bind tricks
> that I've been able to dig up. Any suggestions would be most
> appreciated. The WSDL in question is attached.
>
> Regards,
> Matt
>
> On Mon, Feb 23, 2009 at 10:23 AM, Giovanni Marco Dall'Olio
> <dalloliogm(a)gmail.com <mailto:dalloliogm@gmail.com>
> <mailto:dalloliogm@gmail.com <mailto:dalloliogm@gmail.com>>>
> wrote:
>
> On Mon, Feb 23, 2009 at 3:56 PM, Jeff Ortel
> <jortel(a)redhat.com <mailto:jortel@redhat.com>
> <mailto:jortel@redhat.com <mailto:jortel@redhat.com>>> wrote:
> >
> >
> > Giovanni Marco Dall'Olio wrote:
> >>
> >> Hi people,
> >>
> >> I have received many times the same error "Type not
> found: '(Array,
> >> http://schemas.xmlsoap.org/soap/encoding/, )", when
> using suds to
> >> interrogate some third party wsdl services.
> >
> > This is a schema import issue that is address in:
> > https://fedorahosted.org/suds/wiki/TipsAndTricks under
> heading:
> "Schema -
> > TypeNotFound".
> >
> > Note: Since the problem is so wide spread, 0.3.4
> automatically
> does the
> > bind().
>
> Thank you very much for the quick answer!
> I can confirm you that with 0.3.4 it works well.
>
> One last thing: I am going to report this problem to the
> respective
> maintainers of the various wsdls.
>
>
> >>
> >> I have also posted a bug report here:
> >> - https://fedorahosted.org/suds/ticket/200
> >>
> >> however, hey, please check your bug tracker because
> it seems to have
> >> been spammed.
> >
> > This is big problem on all Fedora Trac projects :-(
> >
> > We're working to resolve the problem.
> >
> >>
> >> Here are the wsdl from which I get the Type not found
> error:
> >> - http://soap.genome.jp/KEGG.wsdl
> >> -
>
> http://www.reactome.org:8080/caBIOWebApp/services/caBIOService?wsdl
> >> - those here:
> http://bond.unleashedinformatics.com/Action? (go to
> >> 'Downloads - WSDL APIs')
> >>
> >> _______________________________________________
> >> fedora-suds-list mailing list
> >> fedora-suds-list(a)redhat.com
> <mailto:fedora-suds-list@redhat.com>
> <mailto:fedora-suds-list@redhat.com
> <mailto:fedora-suds-list@redhat.com>>
>
> >> https://www.redhat.com/mailman/listinfo/fedora-suds-list
> >
>
>
>
> --
>
> My blog on bioinformatics (now in English):
> http://bioinfoblog.it
>
> _______________________________________________
> fedora-suds-list mailing list
> fedora-suds-list(a)redhat.com
> <mailto:fedora-suds-list@redhat.com>
> <mailto:fedora-suds-list@redhat.com
> <mailto:fedora-suds-list@redhat.com>>
>
> https://www.redhat.com/mailman/listinfo/fedora-suds-list
>
>
>
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> fedora-suds-list mailing list
> fedora-suds-list(a)redhat.com <mailto:fedora-suds-list@redhat.com>
> https://www.redhat.com/mailman/listinfo/fedora-suds-list
>
>
>
14 years, 7 months
Re: [Fedora-suds-list] Type not found: '(Array, ..)' on many independent web services
by LLl löl
Unfortunately I have the same problem:
suds-0.3.4-py2.5
import suds.client
url="http://api.google.com/GoogleSearch.wsdl"
client = suds.client.Client(url)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-i686/egg/suds/client.py", line 103, in __init__
File "build/bdist.linux-i686/egg/suds/wsdl.py", line 192, in __init__
File "build/bdist.linux-i686/egg/suds/wsdl.py", line 253, in build_schema
File "build/bdist.linux-i686/egg/suds/xsd/schema.py", line 92, in load
File "build/bdist.linux-i686/egg/suds/xsd/schema.py", line 291, in dereference
File "build/bdist.linux-i686/egg/suds/xsd/sxbasic.py", line 407, in dependencies
suds.TypeNotFound: Type not found: '(Array, http://schemas.xmlsoap.org/soap/encoding/, )
14 years, 7 months
Issue with date type responses interpreted as dateTime
by Jonathan Bell
I'm using version 0.3.4 to parse UV index values from epa.gov's SunWise SOAP
service. The output includes a complex type with 3 values: alert,
forecastDate and index.
The result XML is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getUVIndexAlertByZipCodeResponse soapenv:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:uvindexalert">
<getUVIndexAlertByZipCodeReturn href="#id0"/>
</ns1:getUVIndexAlertByZipCodeResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:UVIndexAlertResult"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="urn:uvindexalert">
<alert xsi:type="xsd:boolean">false</alert>
<forecastDate xsi:type="xsd:date">2009-02-25</forecastDate>
<index xsi:type="xsd:int">4</index>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
The forecastDate is returned as <forecastDate
xsi:type="xsd:date">2009-02-25</forecastDate>, which would suggest it be
handled as an XDate. The traceback location (line 226) suggests that suds is
actually treating it as an XDateTime and splitting on a non-existent "T"
character.
from suds.client import Client
url = 'http://iaspub.epa.gov/uvindexalert/services/UVIndexAlertPort?wsdl'
client = Client(url)
client.service.getUVIndexAlertByZipCode(in0='37919')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "build/bdist.linux-x86_64/egg/suds/client.py", line 228, in __call__
File "build/bdist.linux-x86_64/egg/suds/client.py", line 367, in call
File "build/bdist.linux-x86_64/egg/suds/client.py", line 228, in __call__
File "build/bdist.linux-x86_64/egg/suds/client.py", line 410, in call
File "build/bdist.linux-x86_64/egg/suds/client.py", line 468, in invoke
File "build/bdist.linux-x86_64/egg/suds/client.py", line 493, in send
File "build/bdist.linux-x86_64/egg/suds/client.py", line 525, in succeeded
File "build/bdist.linux-x86_64/egg/suds/bindings/binding.py", line 135, in
get_reply
File "build/bdist.linux-x86_64/egg/suds/bindings/unmarshaller.py", line
302, in process
File "build/bdist.linux-x86_64/egg/suds/bindings/unmarshaller.py", line
87, in process
File "build/bdist.linux-x86_64/egg/suds/bindings/unmarshaller.py", line
103, in append
File "build/bdist.linux-x86_64/egg/suds/bindings/unmarshaller.py", line
180, in append_children
File "build/bdist.linux-x86_64/egg/suds/bindings/unmarshaller.py", line
104, in append
File "build/bdist.linux-x86_64/egg/suds/bindings/unmarshaller.py", line
404, in append_text
File "build/bdist.linux-x86_64/egg/suds/bindings/unmarshaller.py", line
410, in translated
File "build/bdist.linux-x86_64/egg/suds/xsd/sxdate.py", line 273, in
translate
File "build/bdist.linux-x86_64/egg/suds/xsd/sxdate.py", line 226, in
toPython
ValueError: need more than 1 value to unpack
=============
Line 226 in sxdate.py is part of the XDateTime handler, not XDate as
expected.
Adding a filter to include a time in the output XML, makes the output
parseable:
from suds.bindings.binding import Binding
Binding.replyfilter = (lambda x,y: y.replace('</forecastDate>',
'T00:00:00</forecastDate>'))
client.service.getUVIndexAlertByZipCode(in0='37919')
(UVIndexAlertResult){
alert = False
forecastDate = 2009-02-25 00:00:00
index = 4
}
--
Jonathan
14 years, 7 months
Error with WSDL file?
by Lynton Grice
Hi guys,
I wonder if you can help me, I am trying to get a particular WSDL file to
work and see to be having some bad luck......
Here is the basic code for now....
from suds.client import Client
wsdl = "file:///c://DummyData_Out_Async.wsdl"
client = Client(wsdl)
print client
I get an error like follows: "NoneType" object has no attribute 'get'
Can anyone tell me why the attached WSDL file doesn't work with SUBS? Please
find WSDL file attached....
Thanks for the help ;-)
Lynton
14 years, 7 months
Does suds support signed SOAP messages?
by Eric Chamberlain
Hello,
We need our SOAP client to sign the SOAP message header with an X.509
certificate. Does suds have support for signing SOAP messages?
--
Eric Chamberlain
14 years, 7 months
ArrayOfString
by Witzel, Stefan
Hello,
sorry about this newbie question:
One oft the arguments of a service has type ArrayOfString.
<Complex:0x85992cc name="ArrayOfString">
<ComplexContent:0x859936c>
<Restriction:0x859946c ref="[u'soapenc:Array', False]">
<Attribute:0x860f66c name="arrayType" ref="[u'tns:arrayType',
False]" type="xs:string" />@
<Attribute:0x860f74c name="offset" ref="[u'tns:offset', False]"
type="tns:arrayCoordinate" />@
<Attribute:0x860f2ec name="id" ref="[None, False]" type="xs:ID"
/>@
<Attribute:0x860f3cc name="href" ref="[None, False]"
type="xs:anyURI" />@
<Attribute:0x859956c name="arrayType"
ref="[u'soapenc:arrayType', False]" type="xs:string" />@
<Any:0x860fa6c />
</Restriction>
</ComplexContent>
</Complex>
I don't know how to assign a value to a variable of this type.
client = Client(url)
altNames = client.factory.create('ArrayOfString')
Assigning ['string'] sends to the server
<AltNames xsi:type="ArrayOfString">string</AltNames>
with answer:
Application failed during request deserialization: Unspecified namespace for
type 'ArrayOfString'
Thanks in advance.
Stefan
_______________________________________
Georg-August-Universität Göttingen
Stiftung Öffentlichen Rechts
Stabsstelle Datenverarbeitung
Goßlerstraße 5/7
37073 Göttingen
Telefon 0551 / 39-4160
Fax 0551 / 39-184160
E-Mail stefan.witzel(a)zvw.uni-goettingen.de
14 years, 7 months
TypeNotFound issue
by Matt C
Thanks for the project - it looks extremely promising. I've read the tips
and tricks section and a few other resources, but I can't seem to get past
the cursed <class 'suds.TypeNotFound'>: Type not found: '(Array,
http://schemas.xmlsoap.org
/soap/encoding/, )' error.
At this point I'm just trying to cleanly load a WSDL and poke around a bit
to see how well suds handles arrays. Here's a tiny snippet:
In [69]: from suds.client import Client
In [70]: from suds.xsd.sxbasic import Import
In [71]: Import.bind("http://schemas.xmlsoap.org/soap/encoding/")
In [72]: url =
'file:\\c:\\users\\tester\\Desktop\\python_stuff\\LocalLB.Pool.wsdl'
In [73]: Client(url)
...which generates the error, as opposed to an object.
Any suggestions would be most welcome. I've attached the suspect WSDL as
well.
Regards,
Matt
14 years, 7 months