Exemple #1
0
class SudsClient(object):

    zope.interface.implements(ClientAdapter)

    def __init__(self, wsdl, options={}):

        if 'headers' not in options:
            options['headers'] = {}

        if 'plugins' not in options:
            options['plugins'] = []

        options['headers'].update({'Accept-Encoding': 'gzip'})
        options['plugins'].append(SupportGZIPPlugin())

        self.client = Client(wsdl, **options)
        self.client.connect()

    def set_headers(self, headers):
        self.client.set_options(soapheaders=headers)

    def send_request(self, method_name, params):
        return getattr(self.client.service, method_name)(**params)

    def get_last_response(self):
        return self.client.last_received()

    def get_last_request(self):
        return self.client.last_sent()

    def new_context(self):
        return SudsClientProxy(self)
Exemple #2
0
class SudsClient(object):

    zope.interface.implements(ClientAdapter)

    def __init__(self, wsdl, options={}):

        if 'headers' not in options:
            options['headers'] = {}

        if 'plugins' not in options:
            options['plugins'] = []

        options['headers'].update({'Accept-Encoding': 'gzip'})
        options['plugins'].append(SupportGZIPPlugin())

        self.client = Client(wsdl, **options)
        self.client.connect()

    def set_headers(self, headers):
        self.client.set_options(soapheaders=headers)

    def send_request(self, method_name, params):
        return getattr(self.client.service, method_name)(**params)

    def get_last_response(self):
        return self.client.last_received()

    def get_last_request(self):
        return self.client.last_sent()

    def new_context(self):
        return SudsClientProxy(self)
Exemple #3
0
class SudsClient(object):

    zope.interface.implements(ClientAdapter)

    def __init__(self, wsdl, options={}):
        if not 'plugins' in options:
            options['plugins'] = [SoapEnvelopeNamespaceFix()]
        else:
            options['plugins'].append(SoapEnvelopeNamespaceFix())

        # TODO: add headers for compression per provider/request
        if not 'headers' in options:
            options['headers'] = {}
        options['headers'].update({"Accept-Encoding": "gzip"})
        options['plugins'] = [SupportGZIPPlugin()]

        self.client = Client(wsdl, **options)
        self.client.connect()

    def set_headers(self, headers):
        self.client.set_options(soapheaders=headers)

    def send_request(self, method_name, params):
        return getattr(self.client.service, method_name)(**params)

    def get_last_response(self):
        return self.client.last_received()

    def get_last_request(self):
        return self.client.last_sent()

    def new_context(self):
        return SudsClientProxy(self)
Exemple #4
0
class SudsClient(object):

    zope.interface.implements(ClientAdapter)

    def __init__(self, wsdl, options={}):
        if not 'plugins' in options:
            options['plugins'] = [SoapEnvelopeNamespaceFix()]
        else:
            options['plugins'].append(SoapEnvelopeNamespaceFix())

        # TODO: add headers for compression per provider/request
        if not 'headers' in options:
            options['headers'] = {}
        options['headers'].update({"Accept-Encoding": "gzip"})
        options['plugins'] = [SupportGZIPPlugin()]

        self.client = Client(wsdl, **options)
        self.client.connect()

    def set_headers(self, headers):
        self.client.set_options(soapheaders=headers)

    def send_request(self, method_name, params):
        return getattr(self.client.service, method_name)(**params)

    def get_last_response(self):
        return self.client.last_received()

    def get_last_request(self):
        return self.client.last_sent()

    def new_context(self):
        return SudsClientProxy(self)
Exemple #5
0
class SoapClient(object):

	def __init__(self, wsdl):
		self.client = Client(wsdl, plugins=[SoapEnvelopeNamespaceFix()])
		self.client.connect()
		self.client.set_options(nosend=True)

	def setHeaders(self, headers):
		self.client.set_options(soapheaders=headers)

	"""
    Fake send function.
    @return: deferred
    """
	def body(self, methodName, params):
		return getattr(self.client.service, methodName)(**params)
Exemple #6
0
class SoapClient(object):
    def __init__(self, wsdl):
        self.client = Client(wsdl, plugins=[SoapEnvelopeNamespaceFix()])
        self.client.connect()
        self.client.set_options(nosend=True)

    def setHeaders(self, headers):
        self.client.set_options(soapheaders=headers)

    """
    Fake send function.
    @return: deferred
    """

    def body(self, methodName, params):
        return getattr(self.client.service, methodName)(**params)
Exemple #7
0
def main():
    try:
        url = 'https://sec.neurofuzz-software.com/paos/genSSHA-SOAP.php?wsdl'
        print 'Test @ ( %s )' % (url)
        client = Client(url)
        yield client.connect()
        print client
        res = yield client.service.genSSHA('hello', 'sha1')
        print res
    except WebFault, f:
        print f
        print f.fault
def main():
   try:
       url = 'https://sec.neurofuzz-software.com/paos/genSSHA-SOAP.php?wsdl'
       print 'Test @ ( %s )' % (url)
       client = Client(url)
       yield client.connect()
       print client
       res = yield client.service.genSSHA('hello', 'sha1')
       print res
   except WebFault, f:
       print f
       print f.fault
from urllib.request import getproxies
from suds.client import Client


WSDL='http://10.17.0.6:8080/FisboxWs/services/Fiskal?wsdl'

client = Client(WSDL, proxy=getproxies()).service

print(client.connect('Python'))
#print(client.getServerVersion())
#print(client.getModuleVersion())
print(client.getModuleDate())
#print(client.getModuleSerialNumber())
#print(client.getModuleInfo())
#print(client.getParagonCopy(100))
print(client.getVatSetup())
print(client.getParagonInfoExtended(5000))