ZSI.generate.Wsdl2PythonError:不支持的本地 simpleType 限制
我有来自外部网络服务的简单类型:
<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>
但是当我启动 wsdl2py -b filename.wsdl 时,我收到此错误:
ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction: <schema targetNamespace="https://xxxxx.yyyyy.zz/sss/"><complexType name="PaymentReq"><sequence><element name="card_number"><simpleType>
我该如何解决此问题?我尝试从 simpleType 更改为 compleType 并且 wsdl2py 生成 python 代码没有问题。这样我就无法在我的Python对象中使用card_number。
谢谢你的帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定情况是否仍然如此,但快速谷歌表明 ZSI 不支持具有用户定义限制基础的 simpleTypes。
如果情况仍然如此,那么您可以修改“card_number”的限制以删除基础并更新 simpleType-restriction 中的限制面以反映基础将提供的内容。
如果您发布
PanType
的限制方面的内容,我们可以告诉您那是什么。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.