Created
June 5, 2015 15:00
-
-
Save brianherman/209af7751444ec308e1b to your computer and use it in GitHub Desktop.
Diamond
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def New_User(self,policy_id=None, token = None, email=None, password = None, domain=None): | |
if policy_id: | |
url2 = "http://uicesv08business/Diamond/BillingService.svc?wsdl" | |
client = SoapClient112(wsdl=self.URL_billing,ns="tem", cache="cache_billingservice") | |
if policy_id: | |
r3 = { | |
'DiamondSecurityToken': token, | |
'RequestData': { | |
'PolicyId': policy_id, | |
} | |
# 'DiamondValidation': ... | |
# 'TestConnectivityOnly': ... | |
} | |
try: | |
resp4=client.GetBillingSummary(**r3) | |
finally: | |
pass | |
clientID = resp4['ResponseData']['BillingSummary']['Summary'][0]['Summary']['m_ClientId'] | |
if policy_id: | |
client = SoapClient112(wsdl=self.URL_admin ,ns="tem", cache="cache_admin") | |
if policy_id: | |
r4 = { | |
'DiamondSecurityToken': token, | |
'RequestData': { | |
'IsNew' : True, | |
'UserSelected' : False, | |
'UserLinkRecords': { | |
'UserLinkBase':{ | |
'IsNew': True, | |
'UserSelected': False, | |
'UsersId': -1, | |
'ClientId': clientID, | |
}, | |
}, | |
'UsersRecord': { | |
'IsNew' : True, | |
'UserSelected': False, | |
'Active': True, | |
'LoginDomain': 'uniqueinsuranceco.com', | |
'LoginName': email, | |
'Password': password, | |
'UserCategoryId': 2, | |
'EmailAddr':email | |
} | |
} | |
} | |
try: | |
if token: | |
resp5=client.SaveUser(**r4) | |
finally: | |
pass | |
return resp5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment