-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoapServer.py
44 lines (35 loc) · 1.34 KB
/
soapServer.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
43
44
import os
from time import ctime
from flask import Flask
from flaskext.enterprise import Enterprise
app = Flask(__name__)
enterprise = Enterprise(app)
Array = enterprise._scls.Array
String = enterprise._sp.String
Integer = enterprise._sp.Integer
class ID(enterprise._scls.ClassModel):
__namespace__ = 'urn:enterprise.soap.sforce.com'
Id = String
class sObject(enterprise._scls.ClassModel):
__namespace__ = 'urn:sobject.enterprise.soap.sforce.com'
Id = String
class Account(sObject):
__namespace__ = 'urn:sobject.enterprise.soap.sforce.com'
AccountNumber = Integer
Type = String
class AccountNotification(enterprise._scls.ClassModel):
__namespace__ = 'http://soap.sforce.com/2005/09/outbound'
Id = String
sObject = Account
class DemoService(enterprise.SOAPService):
__soap_target_namespace__ = 'http://soap.sforce.com/2005/09/outbound'
@enterprise.soap(ID(), ID(), String, String, String, AccountNotification(), _returns=enterprise._sp.Boolean)
def notifications(self, OrganizationId, ActionId, SessionId, EnterpriseUrl, PartnerUrl, Notification):
Ack = True
print Notification.sObject.Id
print Notification.sObject.Type
return Ack
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port)
app.run()