def _wsdl2dispatch(options, wsdl):
kw = dict()<EOL>if options.twisted:<EOL><INDENT>from pyremotevbox.ZSI.twisted.WSresource import WSResource<EOL>kw['<STR_LIT>'] = WSResource<EOL>ss = ServiceDescription(**kw)<EOL>if options.address is True:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if options.address is True:<EOL><INDENT>ss = ServiceDescriptionWSA()<EOL><DEDENT>else:<EOL><INDENT>ss = ServiceDescription(**kw)<EOL><DEDENT><DEDENT>ss.fromWSDL(wsdl)<EOL>file_name = ss.getServiceModuleName()+'<STR_LIT>'<EOL>fd = open( join(options.output_dir, file_name), '<STR_LIT>')<EOL>ss.write(fd)<EOL>fd.close()<EOL>return file_name<EOL>
TOOD: Remove ServiceContainer stuff, and replace with WSGI.