Skip to content

Commit

Permalink
tidying of the examples.multiple_protocol.server module.
Browse files Browse the repository at this point in the history
  • Loading branch information
plq committed Mar 6, 2012
1 parent 45f5af7 commit aeadf5c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions examples/multiple_protocols/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,16 @@
from protocol import PngClock
from protocol import SvgClock

tns = 'rpclib.examples.multiple_protocols'
port = 9910
host = '127.0.0.1'

class HelloWorldService(ServiceBase):
@srpc(_returns=DateTime)
def get_utc_time():
return datetime.utcnow()

if __name__ == '__main__':
from wsgiref.simple_server import make_server

logging.basicConfig(level=logging.DEBUG)
logging.getLogger('rpclib.protocol.xml').setLevel(logging.DEBUG)

rest = Application([HelloWorldService],
tns='rpclib.examples.multiple_protocols',
interface=Wsdl11(), in_protocol=HttpRpc(), out_protocol=HttpRpc())
Expand Down Expand Up @@ -106,9 +104,10 @@ def get_utc_time():
'svg': svg,
})

server = make_server('127.0.0.1', 9910, root)
from wsgiref.simple_server import make_server
server = make_server(host, port, root)

logging.info("listening to http://127.0.0.1:7789")
logging.info("wsdl is at: http://localhost:7789/?wsdl")
logging.basicConfig(level=logging.DEBUG)
logging.info("listening to http://%s:%d" % (host,port))

server.serve_forever()

0 comments on commit aeadf5c

Please sign in to comment.