diff --git a/examples/demo/client.py b/examples/demo/client.py index 6384e3c..328f184 100644 --- a/examples/demo/client.py +++ b/examples/demo/client.py @@ -10,5 +10,23 @@ print client.service.multiply(4, 5) print client.service.helloworld() print client.service.getperson() p = client.service.listpersons() +print repr(p) p = client.service.setpersons(p) +print repr(p) + +p = client.factory.create('ns0:Person') +p.id = 4 print p + +a = client.factory.create('ns0:Person_Array') +print a + +a = client.service.setpersons(a) +print repr(a) + +a.item.append(p) +print repr(a) + +a = client.service.setpersons(a) +print repr(a) + diff --git a/examples/demo/demo.py b/examples/demo/demo.py index 6553b21..aca9a12 100644 --- a/examples/demo/demo.py +++ b/examples/demo/demo.py @@ -26,6 +26,15 @@ class Person(object): firstname = unicode lastname = unicode + hobbies = [unicode] + + def __repr__(self): + return "Person(%s, %s %s, %s)" % ( + self.id, + self.firstname, self.lastname, + self.hobbies + ) + class DemoRoot(WSRoot): @expose(int) @@ -48,6 +57,8 @@ class DemoRoot(WSRoot): p.id = 12 p.firstname = u'Ross' p.lastname = u'Geler' + p.hobbies = [] + print p return p @expose([Person]) @@ -62,6 +73,7 @@ class DemoRoot(WSRoot): p.firstname = u('Rachel') p.lastname = u('Green') r.append(p) + print r return r @expose(Person) @@ -72,6 +84,7 @@ class DemoRoot(WSRoot): @expose([Person]) @validate([Person]) def setpersons(self, persons): + print persons return persons