Question

i have this simple type from an external webservice:

<xsd:element name="card_number" maxOccurs="1"
minOccurs="1">
<xsd:simpleType>
    <xsd:restriction base="tns:PanType">
        <xsd:pattern value="\d{16}"></xsd:pattern>
        <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
    </xsd:restriction>
</xsd:simpleType>
</xsd:element>

but whe i launch wsdl2py -b filename.wsdl i got this error:

ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction: <schema targetNamespace="https://xxxxx.yyyyy.zz/sss/"><complexType name="PaymentReq"><sequence><element name="card_number"><simpleType>

How can i fix this? I tried to change from simpleType to compleType and wsdl2py generate python code without problem. In this way i can't be able to use card_number in my python object.

Thanks for helping.

Was it helpful?

Solution

I'm not sure if this is still the case, but a quick google suggests that simpleTypes with user-defined restriction bases aren't supported by ZSI.

If this is still the case, then you could modify the restriction for "card_number" to remove the base and update the restriction-facets within the simpleType-restriction to reflect what the base would have provided.

If you post the content of restriction facets for PanType, we can tell you what that would be.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top