def SendSms2Server(self,message,phoneNumber): sendMessage=message.decode('GBK').encode('UTF-8') fp=open(r'D:\Projects\boc\logs\sms.log','a+') b=NPBinding(url='http://xxx:xxx:xxx:xxx:8080/axis/services/SendSms?wsdl',tracefile=fp) b.SetAuth(AUTH.httpbasic,'sendsms','') b.sendSms(phoneNumber=phoneNumber,message=sendMessage) fp.close()
from ZSI.client import NamedParamBinding as NPBinding import sys from ZSI.client import AUTH b = NPBinding(url='http://:8080/axis/services/SendSms?wsdl', tracefile=sys.stdout) b.SetAuth(AUTH.httpbasic, 'sendsms', '') message = 'kkkkkkkkk' a = message.decode('GBK').encode('UTF-8') b.sendSms(phoneNumber='1111111111', message=a)