Ticket #322: client_mvt_322.py

File client_mvt_322.py, 0.6 KB (added by mvtellingen, 4 months ago)

correct client.py

Line 
1import logging
2       
3logging.basicConfig(
4    level=logging.DEBUG,
5    format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
6)
7
8from pyamf.remoting.client import RemotingService
9
10import pyamf
11
12client = RemotingService('http://localhost:8080')
13
14class 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)
21pyamf.register_class(User, 'org.pyamf.User')
22
23service1 = client.getService('example')
24print service1.testn('Hello World')
25print service1.add('user1234', 'John Doe', 'secret')