Zeep:需要转换这个示例肥皂请求
Zeep : Need to convert this sample soap request
肥皂请求:
<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 元素构建字典
已创建字典对象:
{'credentialManagementRequestList': { 'acspManagementRequestData': { 'payload': { '@type' : 'OTPManagementRequest' } } }}
获取错误:
TypeError: {http://ws.csd.rsa.com}AcspManagementRequest() got an unexpected keyword argument >'@type'. Signature: opcode: xsd:string
回答我自己的问题:
我应该获取 OTPManagement 对象的类型,而不是解析 @type 。
"payload': { client.get_type('ns0:OTPManagementRequest') }
肥皂请求:
<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 元素构建字典
已创建字典对象:
{'credentialManagementRequestList': { 'acspManagementRequestData': { 'payload': { '@type' : 'OTPManagementRequest' } } }}
获取错误:
TypeError: {http://ws.csd.rsa.com}AcspManagementRequest() got an unexpected keyword argument >'@type'. Signature: opcode: xsd:string
回答我自己的问题:
我应该获取 OTPManagement 对象的类型,而不是解析 @type 。
"payload': { client.get_type('ns0:OTPManagementRequest') }