2017-10-17 55 views
0

SOAP請求轉換:ZEEP:需要把這個樣本SOAP請求

<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:有效載荷元素

Dictionary對象創建:

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

四處錯誤:

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

回答

0

回答我的問題:

,而不是分析@type的,我應該得到OTPManagement對象的類型。

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