Re: [Rslib-talk] Type token in namespace http://www.w3.org/2001/XMLSchema not found
Status: Alpha
Brought to you by:
gweis
|
From: Gerhard W. <ger...@gm...> - 2009-08-26 03:46:04
|
Hello,
thanks for that and great to hear, that the library is also useful for
others.
I am currently a bit busy, but I will definitely have a closer look at
your problem later today or tomorrow.
However, as of a quick look I would say I forgot to register the
xsd:token type.
You can try to fix it in the rsl.xsd package the following way:
in rsl/xsd/factories.py int the method: createXSD01Schema add the
line:
xsd.types["token"] = AnySimpleType("token", xsd)
While I can't guarantee that this will work, I think it should do it.
As mentioned above, I'll do a new release today or tomorrow after
running the test-suite with this change.
As a note: Type restrictions based on xsd:enumeration are currently
ignored by rsl.xsd ... You can definitely work with it, but you have
to care yourself about suppllying correct values to this attribute.
Regards,
Gerhard
On 26/08/2009, at 12:08 PM, Nathan Davis wrote:
> Hello,
>
> First of all, I want to thank the RSL developer(s) for the work
> they've done. I've had problems with other web services libraries,
> like SOAPpy, which RSL seems to handle just fine. Keep up the good
> work!
>
> I'm trying to call the web service described by https://voltage-pp-0000.poc5.vspilot.org/vibesimple/wsdl
> . I'm using RSL 0.2.1 with the following code to invoke the
> ProtectCreditCardNumber function:
>
> import rsl.wsdl.wsdl
>
> wsdl_url = "https://voltage-pp-0000.poc5.vspilot.org/vibesimple/wsdl"
> wsdl = rsl.wsdl.wsdl.loadWSDL(wsdl_url)
> proxy = wsdl.getProxy()
>
> proxy.ProtectCreditCardNumber("123456789", "user", None,
> "UserPassword", \
> "password")
> When I run this, however, I get the following exception:
> KeyError: 'Type token in namespace http://www.w3.org/2001/XMLSchema
> not found'
> I believe this is because of the 4th parameter. It's type,
> AuthMethod, is defined in the WSDL as follows:
> <xsd:simpleType name="AuthMethod">
> <xsd:restriction base="xsd:token">
> <xsd:enumeration value="UserPassword"/>
> <xsd:enumeration value="SharedSecret"/>
> <xsd:enumeration value="Certificate"/>
> <xsd:enumeration value="AuthToken_HMAC_SHA1"/>
> </xsd:restriction>
> </xsd:simpleType>
> Am I doing something wrong, or is this a bug/limitation in RSL?
>
> The exception stacktrace is as follows:
> Traceback (most recent call last):
> File "protectcc_example.py", line 8, in <module>
> print proxy.ProtectCreditCardNumber("123456789", "user", None,
> "UserPassword", "password")
> File "build/bdist.linux-x86_64/egg/rsl/soap11/proxy.py", line 109,
> in __call__
> File "build/bdist.linux-x86_64/egg/rsl/soap11/proxy.py", line 130,
> in serialize
> File "build/bdist.linux-x86_64/egg/rsl/soap11/serializer.py", line
> 125, in serialize
> File "build/bdist.linux-x86_64/egg/rsl/xsd/serializer.py", line
> 67, in serialize
> File "build/bdist.linux-x86_64/egg/rsl/xsd/serializer.py", line
> 129, in serialize
> File "build/bdist.linux-x86_64/egg/rsl/xsd/serializer.py", line
> 199, in _serialize
> File "build/bdist.linux-x86_64/egg/rsl/xsd/serializer.py", line
> 169, in _serialize
> File "build/bdist.linux-x86_64/egg/rsl/xsd/serializer.py", line
> 156, in _serialize
> File "build/bdist.linux-x86_64/egg/rsl/xsd/component.py", line
> 189, in encode
> File "build/bdist.linux-x86_64/egg/rsl/xsd/component.py", line
> 275, in encode
> File "build/bdist.linux-x86_64/egg/rsl/xsd/component.py", line
> 247, in _getbasecontent
> File "build/bdist.linux-x86_64/egg/rsl/xsd/schema.py", line 248,
> in getType
> KeyError: 'Type token in namespace http://www.w3.org/2001/XMLSchema
> not found'
>
> Thanks,
>
> Nathan Davis
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july_______________________________________________
> Rslib-talk mailing list
> Rsl...@li...
> https://lists.sourceforge.net/lists/listinfo/rslib-talk
|