When trying to generate the server stub using wsdl2py on a wsdl file automatically generated by axis2, I get this error:
$ wsdl2py -blu http://localhost:8080/axis2/services/HelloServer?wsdl
Traceback (most recent call last):
File "/usr/bin/wsdl2py", line 9, in <module>
wsdl2py()
File "/var/lib/python-support/python2.5/ZSI/generate/commands.py", line 223, in wsdl2py
wsm.writeClient(fd)
File "/var/lib/python-support/python2.5/ZSI/generate/wsdl2python.py", line 211, in writeClient
sd.fromWsdl(service, **kw)
File "/var/lib/python-support/python2.5/ZSI/generate/wsdl2python.py", line 289, in fromWsdl
mw.setUp(soc, port, input=True)
File "/var/lib/python-support/python2.5/ZSI/generate/wsdl2python.py", line 362, in setUp
self.content.setUp(port, soc, input)
File "/var/lib/python-support/python2.5/ZSI/generate/containers.py", line 815, in setUp
raise Wsdl2PythonError, 'must specify part for doc/lit msg'
ZSI.generate.Wsdl2PythonError: must specify part for doc/lit msg
One of the server function takes no parameter and apparently this is a problem because the wsdl generated by axis is like this:
<wsdl:message name="HelloRequest"/>
and wsdl2py expects a <wsdl:part ...> in it.
I think ZSI should handle this better and not crash.
Note: I tried both ZSI2.0 and ZSI svn (2.1?) and they both crashed the same way.
WSDL file
Logged In: YES
user_id=1118446
Originator: NO
Hello,
I'm having the same problem with axis.
Is there a way to avoid/solve the issue?
Here is the offending entity:
<wsdl:message name="HelloRequest"/>
From http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#WSDLMSGS
""""Use of wsdl:message elements with zero parts is permitted in Document styles to permit operations that can send or receive messages with empty soap:Bodys.""""
Basically what needs to be done here is an empty <soap:Body> is sent...
Now only ONE operation should be able to specify an message w/o a part ( for doc/lit ), because the wire representation of each operation MUST be unique.
I just added a unittest into svn. These tests are approximate expected/correct behavior.
$ cd zsi/test/wsdl2py
$ python test_NoMessagePart.py local
...
$ python test_NoMessagePart.py dispatch
...