-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsms.py
executable file
·42 lines (33 loc) · 1.06 KB
/
sms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python
import sys
import uuid
from OMSService_client import *
loc = OMSServiceLocator()
kw = { 'tracefile' : sys.stdout }
port = loc.getOMSServiceSoap(**kw)
deliverXmsMsg = DeliverXmsSoapIn()
xmsData = ns0.xmsData_Dec().pyclass()
xmsData.set_attribute_client('Python SMS Client 1.0')
user = xmsData.new_user()
user.UserId = ''
user.Password = ''
user.ReplyPhone = ''
user.CustomData = ''
xmsData.User = user
xmsHead = xmsData.new_xmsHead()
xmsHead.To = xmsHead.new_to()
xmsHead.To.Recipient = ['']
xmsHead.SourceType = 'other'
xmsHead.RequiredService = xmsHead.new_requiredService('SMS_SENDER')
xmsData.XmsHead = xmsHead
xmsBody = xmsData.new_xmsBody()
xmsBody.set_attribute_format('SMS')
content = xmsBody.new_content('Hello, World!')
content.set_attribute_contentType('text/plain')
content.set_attribute_contentId(str(uuid.uuid4()))
content.set_attribute_contentLocation('1.txt')
xmsBody.Content.append(content)
xmsData.XmsBody = xmsBody
writer = ZSI.SoapWriter(envelope=0)
deliverXmsMsg.XmsData = writer.serialize(xmsData)
rsp = port.DeliverXms(deliverXmsMsg)