Esempio n. 1
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
Esempio n. 2
0
from twisted.internet import defer

errors = 0

setup_logging()

#logging.getLogger('suds.client').setLevel(logging.DEBUG)

url = 'http://localhost:8080/axis2/services/BasicService?wsdl'

print 'url=%s' % url

#
# create a service client using the wsdl.
#
client = Client(url)


@defer.inlineCallbacks
def connect():
    yield client.connect()
print 'connecting...',
connect()
print 'connected'


#
# print the service (introspection)
#
print client
Esempio n. 3
0
def rhqTest():

    global errors

    url = 'http://localhost.localdomain:7080/rhq-rhq-enterprise-server-ejb3/WebservicesManagerBean?wsdl'
    start(url)
    client = Client(url)
    print client

    try:

        #
        # create name
        #
        name = client.factory.create('name')
        name.first = u'Jeff'+unichr(1234)
        name.last = 'Ortel < Company'
        #
        # create a phone object using the wsdl
        #
        phoneA = client.factory.create('phone')
        phoneA.npa = 410
        phoneA.nxx = 555
        phoneA.number = 5138
        phoneB = client.factory.create('phone')
        phoneB.npa = 919
        phoneB.nxx = 555
        phoneB.number = 4406
        #
        # lets add some animals
        #
        dog = client.factory.create('dog')
        dog.name = 'rover'
        dog.age = 3
        cat = client.factory.create('cat')
        cat.name = 'kitty'
        cat.age = 4
        #
        # create a person object using the wsdl
        #
        person = client.factory.create('person')
        print person
        person.name = name
        person.age = 43
        person.phone.append(phoneA)
        person.phone.append(phoneB)
        person.pet.append(dog)
        person.pet.append(cat)
        print person
        #
        # addPerson()
        #
        print 'addPersion()'
        result = client.service.addPerson(person)
        sent = client.last_sent()
        rcvd = client.last_received()
        print '\nreply(\n%s\n)\n' % result
        #
        # create a new name object used to update the person
        #
        newname = client.factory.create('name')
        newname.first = 'Todd'
        newname.last = None
        #
        # update the person's name (using the webservice)
        #
        print 'updatePersion()'
        result = client.service.updatePerson(person, newname)
        print '\nreply(\n%s\n)\n' % str(result)
        result = client.service.updatePerson(person, None)
        print '\nreply(\n%s\n)\n' % str(result)
    except WebFault, f:
        errors += 1
        print f
        print f.fault