Menu

#215 schema import bug/ arrayType handling

open
zsi (169)
5
2007-10-01
2007-10-01
No

I also get the following error (not sure what it means) when I try to
generate the stub files with:

wsdl2py -bu
http://www.reactome.org:8080/caBIOWebApp/services/caBIOService?wsdl

Error loading
http://www.reactome.org:8080/caBIOWebApp/services/caBIOService?wsdl:

'LazyEval' object has no attribute 'attributes'

error loading
http://www.reactome.org:8080/caBIOWebApp/services/caBIOService?wsdl

Any hint?.

This was a schema import bug, a known namespaces import (like soapenc) is causing this trouble.

<!--import namespace="http://schemas.xmlsoap.org/soap/encoding/" /-->

So I added a little logic and fixed this in svn trunk,

but encountered another problem with the WSDL:

ZSI.generate.Wsdl2PythonError: (u'Failure in setUp: <schema targetNamespace="http://www.reactome.org/caBIOWebApp/schema"><complexType name="ArrayOfAnyType">', 'soapenc:array derivation declares attribute reference ("http://schemas.xmlsoap.org/soap/encoding/","arrayType"), but does not declare attribute ("http://schemas.xmlsoap.org/wsdl/","arrayType")')

This is incorrect:

<complexType name="ArrayOfAnyType">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
soapenc:arrayType="xsd:anyType[]" />
</restriction>
</complexContent>
</complexType>

Change this to

<complexType name="ArrayOfAnyType">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:anyType[]" />
</restriction>
</complexContent>
</complexType>

Now it should work, however, I shouldn't be raising an uncaught exception here.

Really I should just assume you want "anyType", so I'll create a warning because I figure you are doing something wrong if you reference "soapenc:arrayType" attribute but do not specify the "wsdl:arrayType" attribute.

Discussion

  • Joshua Boverhof

    Joshua Boverhof - 2007-10-01

    Logged In: YES
    user_id=711996
    Originator: YES

    Revision: 1416
    http://pywebsvcs.svn.sourceforge.net/pywebsvcs/?rev=1416&view=rev
    Author: boverhof
    Date: 2007-10-01 12:56:26 -0700 (Mon, 01 Oct 2007)

    Log Message:
    -----------
    M XMLSchema.py

    -- lazy evaluation of known namespace bombing when that schema is not passed in. It should be ignored, esp if it is a well known schema like SOAPENC or XSD

    Modified Paths:
    --------------
    trunk/wstools/XMLSchema.py

    Revision: 1417
    http://pywebsvcs.svn.sourceforge.net/pywebsvcs/?rev=1417&view=rev
    Author: boverhof
    Date: 2007-10-01 13:04:29 -0700 (Mon, 01 Oct 2007)

    Log Message:
    -----------
    M ZSI/generate/containers.py
    -- added some logic to better handle "wsdl:arrayType" in a soapenc:arrayType attribute reference.
    -- throw warning if detect the attribute reference w/o the attribute
    -- else pass thru

    M ZSI/TCcompound.py
    -- if "ofwhat" in Array constructor is None then use "Any()" instance like soap spec demands.

    Modified Paths:
    --------------
    trunk/zsi/ZSI/TCcompound.py
    trunk/zsi/ZSI/generate/containers.py

     
  • Joshua Boverhof

    Joshua Boverhof - 2007-10-01

    Logged In: YES
    user_id=711996
    Originator: YES

    Still having problems with this generated code:

    GTD("http://schemas.xmlsoap.org/soap/encoding/","long",lazy=False)

    returns None

    This is a long standing issue that should be resovled.

    Basically just create new class definitions for each soapenc type from each typecode corresponding to an "xsi:type", rather than using one typecode class for both. Can script this at the bottom of "TC" module, register them.

     

Log in to post a comment.