AdaptiveAuthentication.txt Zeep版本:2.4.0
您好,
我是Zeep的新手,能够构建soap客户端和解析响应。 我的一个请求面临问题,我们无法根据有效负载进行构建。
请求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.csd.rsa.com">
<soapenv:Header/>
<soapenv:Body><ws:updateUser>
<ws:request>
<ws:credentialManagementRequestList>
<ws:acspManagementRequestData>
<ws:credentialProvisioningStatus>ACTIVE</ws:credentialProvisioningStatus>
<ws:payload xsi:type="ns835:OOBSMSManagementRequest" xmlns:ns835="http://ws.oobsms.csd.rsa.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--Optional:-->
<!--Optional:-->
<ws1:action xmlns:ws1="http://ws.oobgen.csd.rsa.com">ADD</ws1:action>
<!--Zero or more repetitions:-->
<ws1:contactList xmlns:ws1="http://ws.oobgen.csd.rsa.com">
<!--Optional:-->
<ws1:isDefault>true</ws1:isDefault>
<ws1:phoneNumber>${#Project#phoneNumber}</ws1:phoneNumber>
<ws1:countryCode>${#Project#countryCode}</ws1:countryCode>
<ws1:areaCode>${#Project#areaCode}</ws1:areaCode>
<ws1:label>${#Project#label}</ws1:label>
<!--Optional:-->
<!--Optional:-->
<!--Optional:-->
<!--Optional:-->
<!--Optional:-->
</ws1:contactList>
</ws:payload>
</ws:acspManagementRequestData>
</ws:credentialManagementRequestList>
<ws:runRiskType>ALL</ws:runRiskType>
</ws:request>
</ws:updateUser>
代码:
update_oob_sms = {'credentialManagementRequestList': {
'acspManagementRequestData': {
'credentialProvisioningStatus': 'ACTIVE',
'payload': {
'@type': 'ns835:OOBSMSManagementRequest',
'action': 'ADD',
'contactList': {
'isDefault': 'true',
'phoneNumber': '4332223',
'countryCode': '972',
'areaCode': '50',
'label': 'label'
}
}
}
}}
update_user_request = self.soap.client.get_type('ns0:UpdateUserRequest') self.soap.service.updateUser(update_user_request(** update_oob_sms))
响应:TypeError:{http://ws.csd.rsa.com} AcspManagementRequest()得到了 意外的关键字参数'contactList'。签名:操作码:xsd:string
当我输入
时打印(client.get_type( 'NS0:AcspManagementRequest'))
回应:
AcspManagementRequest({http://ws.csd.rsa.com} AcspManagementRequest(操作码:xsd:string))
看起来它只接受字符串。如果我尝试将有效负载值转换为字符串并发送,我会收到 fault:unknown 的响应。请帮助