parent
56357e3f4a
commit
bef6717dfb
@ -1,35 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import httplib
|
||||
|
||||
WORK_HTTPS = httplib.HTTPS
|
||||
|
||||
CERT_FILE = 'client.crt'
|
||||
KEY_FILE = 'client.key'
|
||||
|
||||
|
||||
#CERT_FILE = None
|
||||
#KEY_FILE = None
|
||||
|
||||
class MOD_HTTPS(httplib.HTTPS):
|
||||
def __init__(self, host='', port=None, key_file=KEY_FILE,
|
||||
cert_file=CERT_FILE,
|
||||
strict=None):
|
||||
WORK_HTTPS.__init__(self, host=host, port=port,
|
||||
key_file=key_file, cert_file=cert_file,
|
||||
strict=strict)
|
||||
|
||||
httplib.HTTPS = MOD_HTTPS
|
||||
|
||||
import SOAPpy
|
||||
server = SOAPpy.SOAPProxy("https://10.0.0.53:8080/")
|
||||
#print server.push("ten")
|
||||
print server.getApiAttrLib('calculate_ldap.updateVars')
|
||||
print server.getApiAttrLib('calculate_ldap.var.ld_temp_hash')
|
||||
|
||||
print server.getApiAttrLib('calculate_ldap.updateVars')
|
||||
print server.getApiAttrLib('calculate_ldap.var.ld_temp_hash')
|
||||
|
||||
print server.getApiAttrLib('calculate_ldap.scheme')
|
||||
print
|
||||
print server.getApiAttrLib('calculate_ldap.scheme')
|
||||
|
@ -1,43 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import SOAPpy
|
||||
from M2Crypto import SSL
|
||||
|
||||
ssl_context = SSL.Context('sslv3')
|
||||
ssl_context.load_verify_locations(cafile='CA.crt')
|
||||
ssl_context.load_cert(certfile='server.crt',
|
||||
keyfile="server.key")
|
||||
ssl_context.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert,
|
||||
depth=9)
|
||||
import sys, os
|
||||
sys.path.insert(0,os.path.abspath('/usr/lib/calculate-2.2/calculate-lib/pym'))
|
||||
from cl_api import packagesAPI, APIError
|
||||
APIObj = packagesAPI()
|
||||
|
||||
def getApiAttrLib(attr):
|
||||
try:
|
||||
value = eval('APIObj.%s'%attr)
|
||||
except APIError, e:
|
||||
#self.flagError = True
|
||||
#self.printERROR(str(e))
|
||||
return False
|
||||
except Exception, e:
|
||||
#self.flagError = True
|
||||
#self.printERROR(str(e))
|
||||
return False
|
||||
return value
|
||||
|
||||
#print "1", getApiAttrLib('calculate_ldapf.get_prioritet')
|
||||
#print "2", getApiAttrLib('calculate_ldap.var.ur_login')
|
||||
#print "3", getApiAttrLib('all.get_prioritet')
|
||||
#exit(1)
|
||||
def hello(arg):
|
||||
return arg + " " + "Hello World"
|
||||
|
||||
server = SOAPpy.SOAPServer(("10.0.0.53", [8080][0]),ssl_context = ssl_context)
|
||||
server.registerFunction(getApiAttrLib)
|
||||
#server.registerObject(st())
|
||||
while(1):
|
||||
try:
|
||||
server.serve_forever()
|
||||
except SSL.SSLError:
|
||||
pass
|
@ -1,54 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import warnings
|
||||
warnings.simplefilter("ignore",DeprecationWarning)
|
||||
|
||||
#import httplib
|
||||
#WORK_HTTPS = httplib.HTTPS
|
||||
|
||||
#CERT_FILE = 'client.crt'
|
||||
#KEY_FILE = 'client.key'
|
||||
|
||||
##CERT_FILE = None
|
||||
##KEY_FILE = None
|
||||
|
||||
#class MOD_HTTPS(httplib.HTTPS):
|
||||
#def __init__(self, host='', port=None, key_file=KEY_FILE,
|
||||
#cert_file=CERT_FILE,
|
||||
#strict=None):
|
||||
#WORK_HTTPS.__init__(self, host=host, port=port,
|
||||
#key_file=key_file, cert_file=cert_file,
|
||||
#strict=strict)
|
||||
|
||||
#httplib.HTTPS = MOD_HTTPS
|
||||
|
||||
#import urllib
|
||||
|
||||
#class AppURLopener(urllib.FancyURLopener):
|
||||
#def __init__(self, *args, **kwargs):
|
||||
#urllib.FancyURLopener.__init__(self, *args, key_file=KEY_FILE,
|
||||
#cert_file=CERT_FILE, **kwargs)
|
||||
#open_https = urllib.FancyURLopener.open_https
|
||||
#urllib._urlopener = AppURLopener()
|
||||
|
||||
|
||||
|
||||
from SOAPpy import WSDL
|
||||
#wsdl = WSDL.Proxy("http://soap.direct.yandex.ru/wsdl/v1")
|
||||
wsdl = WSDL.Proxy("http://asamoukin.local.calculate.ru:8080")
|
||||
#print wsdl.methods.keys()
|
||||
callInfo = wsdl.methods['ms']
|
||||
for par in callInfo.inparams:
|
||||
print "IN", par.type, par.name
|
||||
|
||||
for par in callInfo.outparams:
|
||||
print "OUT", par.type, par.name
|
||||
|
||||
#wsdl.soapproxy.config.dumpSOAPOut = 1
|
||||
#wsdl.soapproxy.config.dumpSOAPIn = 1
|
||||
mass = wsdl.test(u" Тест ")
|
||||
|
||||
d = wsdl.ms("One")
|
||||
print d[0]
|
||||
print mass
|
||||
|
||||
|
Loading…
Reference in new issue