| 1 | import logging |
|---|
| 2 | |
|---|
| 3 | logging.basicConfig( |
|---|
| 4 | level=logging.DEBUG, |
|---|
| 5 | format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s' |
|---|
| 6 | ) |
|---|
| 7 | |
|---|
| 8 | from pyamf.remoting.client import RemotingService |
|---|
| 9 | |
|---|
| 10 | import pyamf |
|---|
| 11 | |
|---|
| 12 | client = RemotingService('http://localhost:8080') |
|---|
| 13 | |
|---|
| 14 | class User(object): |
|---|
| 15 | def __init__(self): |
|---|
| 16 | pass |
|---|
| 17 | |
|---|
| 18 | def __repr__(self): |
|---|
| 19 | return "<User('%s','%s', '%s')>" % (self.name, self.fullname, |
|---|
| 20 | self.ip) |
|---|
| 21 | pyamf.register_class(User, 'org.pyamf.User') |
|---|
| 22 | |
|---|
| 23 | service1 = client.getService('example') |
|---|
| 24 | print service1.testn('Hello World') |
|---|
| 25 | print service1.add('user1234', 'John Doe', 'secret') |
|---|