soapfish icon indicating copy to clipboard operation
soapfish copied to clipboard

Crash in wsdl2py related to <wsdl:part>

Open ngnpope opened this issue 9 years ago • 4 comments

Running python -m soapfish.wsdl2py -c 'http://slednev.ru/example.wsdl' results in the following crash:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/pope1ni/Sources/soapfish/soapfish/wsdl2py.py", line 121, in <module>
    main()
  File "/home/pope1ni/Sources/soapfish/soapfish/wsdl2py.py", line 112, in main
    code = generate_code_from_wsdl(xml, target, opt.use_wsa, cwd=cwd)
  File "/home/pope1ni/Sources/soapfish/soapfish/wsdl2py.py", line 84, in generate_code_from_wsdl
    use_wsa=use_wsa,
  File "/home/pope1ni/.virtualenvs/polaris/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/pope1ni/.virtualenvs/polaris/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "soapfish/templates/wsdl", line 158, in top-level template code
    def {{ operation.name }}(self, {{ inputMessage.part.element|remove_namespace }}, header=None):
  File "/home/pope1ni/.virtualenvs/polaris/lib/python2.7/site-packages/jinja2/environment.py", line 397, in getattr
    return getattr(obj, attribute)
  File "soapfish/wsdl11.py", line 53, in part
    raise ValueError('expected exactly one part', self.name, self.parts)
ValueError: ('expected exactly one part', 'GetManufacturerListMessage', [])

This issue was introduced in e04a585c.

Note: This ticket is based on a problem found in flightdataservices/soapbox#23

ngnpope avatar Jan 28 '16 16:01 ngnpope

Hello! My WSDL was incorrect. I read RFC and found several errors. After fix all work fine.

russian-developer avatar Jan 28 '16 16:01 russian-developer

Can you confirm that the example at http://slednev.ru/example.wsdl is still incorrect then?

ngnpope avatar Jan 28 '16 17:01 ngnpope

Yes! I'm didn't fix it.

russian-developer avatar Jan 28 '16 18:01 russian-developer

Just wanted to mention that a different problem existed before e04a585 so no regression in functionality (even though it's clearly a bug).

FelixSchwarz avatar Jan 28 '16 21:01 FelixSchwarz