1

AdaptiveAuthentication.txt Zeep 版本:2.4.0

你好,

我是 Zeep 的新手,可以构建肥皂客户端并解析响应。我的一个请求面临问题,我们无法基于有效负载构建。

要求 :

<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:字符串

当我得到类型

打印(client.get_type('ns0:AcspManagementRequest'))

回复 :

AcspManagementRequest({ http://ws.csd.rsa.com }AcspManagementRequest(opcode: xsd:string))

看起来它只接受字符串。如果我尝试将有效负载值转换为字符串并发送,我会收到错误响应:未知。请帮助

4

0 回答 0