|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 玄天宗 于 2018-5-31 12:49 编辑
下面是利用工具soapUI调用的接口代码(红色为接口传入参数xml):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.webservice.hpin.org/">
<soapenv:Header/>
<soapenv:Body>
<ser:pushCustomerInfoFT>
<!--Optional:-->
<arg0><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<reqCustomer>
<eventNo>HL55588899900</eventNo>
<name>阿加</name>
<idNum>513822198906204***</idNum>
<phone>15882275820</phone>
<barCode>FT2033</barCode>
<mealName></mealName >
<familyHistory>有</familyHistory>
<customerHistory>有</customerHistory>
<sex>男</sex>
<age>20</age>
<height>170</height>
<weight>55</weight>
<createTime>2018-05-10 00:00:00</createTime>
<reportReceiveName>测试</reportReceiveName>
<reportReceivePhone>15882275821</reportReceivePhone>
<reportReceiveAddress>成都</reportReceiveAddress>
<authID>FT</authID>
</reqCustomer>]]></arg0>
</ser:pushCustomerInfoFT>
</soapenv:Body>
</soapenv:Envelope>
以下是python调用接口代码:
from suds.client import Client
url = 'http://192.168.1.***:8088/websGene/geneReport?wsdl'
client = Client(url)
reqCustomer = {
'eventNo': 'HL55588899900',
'name': '阿加',
'idNum': '513822198906204***',
'phone': '15882275820',
'barCode': 'FT2033',
'mealName': '1',
'familyHistory': '1',
'customerHistory': '1',
'sex': '男',
'age': '20',
'height': '170',
'weight': '55',
'createTime': '2018-05-10',
'reportReceiveName': 'test',
'reportReceivePhone': '15882275821',
'reportReceiveAddress': '22',
'authID': 'FT'
}
person_adde = client.service.pushCustomerInfoFT(reqCustomer)
print(person_adde)
结果: 报错suds.TypeNotFound: Type not found: 'idNum'
经过反复调整,发现是传入的参数格式等有问题
求大佬指点,xml的参数该怎么传递? |
|