Zeep:需要转换此样本肥皂请求

时间:2017-10-17 11:48:20

标签: python soap zeep

肥皂要求:

<ws:credentialManagementRequestList> <ws:acspManagementRequestData>
<ws:credentialProvisioningStatus>ACTIVE</ws:credentialProvisioningStatus>
<ws:payload xsi:type="ws:OTPManagementRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</ws:acspManagementRequestData> </ws:credentialManagementRequestList>

复杂类型:

<xsd:complexType name="AcspManagementRequestData">
<xsd:annotation
<xsd:documentationThis type defines the Credential Management Request Payload</xsd:documentation>
</xsd:annotation>
<xsd:sequence
<xsd:element name="credentialProvisioningStatus" minOccurs="0" type="rsa_csd:CredentialProvisioningStatus" />
<xsd:element name="payload" minOccurs="0" type="rsa_csd:AcspManagementRequest" />
</xsd:sequence>
</xsd:complexType>

请帮助如何构建ws:payload element

的字典

创建字典对象:

{'credentialManagementRequestList': { 'acspManagementRequestData': { 'payload': { '@type' : 'OTPManagementRequest' } } }}

获取错误:

TypeError: {http://ws.csd.rsa.com}AcspManagementRequest() got an unexpected keyword argument >'@type'. Signature: opcode: xsd:string

1 个答案:

答案 0 :(得分:0)

回答我自己的问题:

我应该得到OTPManagement对象的类型,而不是解析@type。

"payload': { client.get_type('ns0:OTPManagementRequest') }