加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

网上看到的一个suds 给webservice接口函数传入参数的列子

发布时间:2020-12-17 00:34:31 所属栏目:安全 来源:网络整理
导读:http://www.douban.com/group/topic/30890518/ 各位豆友,最近用python开发一个小项目,调用服务商提供的webservice接口( http://202.105.212.1 46:8080/jboss-net/se rvices/SendSMS?wsdl ),接口函数sendSMSV2有一个参数callee,type="impl:ArrayOf_xsd_

http://www.douban.com/group/topic/30890518/
各位豆友,最近用python开发一个小项目,调用服务商提供的webservice接口(http://202.105.212.146:8080/jboss-net/services/SendSMS?wsdl),接口函数sendSMSV2有一个参数callee,type="impl:ArrayOf_xsd_string" ,使用suds调用这个函数时,如何输入callee这个参数??
本人对soap和suds不熟,诚心向各位求教。
import suds
url='http://202.105.212.146:8080/jboss-net/services/SendSMS?wsdl'
client=suds.client.Client(url)
print(client)

======================print(client)===========================================
Suds ( https://fedorahosted.org/suds/ ) ?version: 0.4.1 jurko 3


Service ( SendSMSService ) tns="http://202.105.212.146:8080/jboss-net/services/SendSMS"
? ?Prefixes (2)
? ? ? ns0 = "http://202.105.212.146:8080/jboss-net/services/SendSMS"
? ? ? ns1 = "http://schemas.xmlsoap.org/soap/encoding/"
? ?Ports (1):
? ? ? (SendSMS)
? ? ? ? ?Methods (4):
? ? ? ? ? ? qryOffLineSMS(xs:string ucNumber,xs:string ucPinNum,xs:string rand,xs:string connID)
? ? ? ? ? ? qrySendSMSStat(xs:string ucNumber,xs:int smsFlag,xs:string connID)
? ? ? ? ? ? sendSMS(xs:string uc,xs:string pw,ArrayOf_xsd_string callee,xs:string isreturn,xs:string cont,xs:int msgid,xs:string connID)
? ? ? ? ? ? sendSMSV2(xs:string uc, ArrayOf_xsd_string callee,xs:int msgID,xs:string connID,xs:int charset)
? ? ? ? ?Types (49):
? ? ? ? ? ? ns1:Array
? ? ? ? ? ? ArrayOf_xsd_string
? ? ? ? ? ? ns1:ENTITIES
? ? ? ? ? ? ns1:ENTITY
=========================================
答案:
刚才测试成功,?
client = Client(wsdl_url)?
array = client.factory.create('ns1:Array')?
array.item = ['mobile1','mobile2']?

将array带入参数即可。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读