I am trying to implement a few WS-Enumeration operations but am having
trouble when I run wsdl2java.
I have the following operation in my wsdl:
<wsdl:import
namespace="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
location="WS-Enumeration-2004_09.wsdl"/>
<wsdl:portType...>
...
<wsdl:operation name="ReleaseOp">
<wsdl:input message="wsen-w:ReleaseMessage"
wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/enumeration/Release"/>
<wsdl:output message="wsen-w:ReleaseResponseMessage"
wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/enumeration/ReleaseRes
ponse"/>
</wsdl:operation>
In WS-Enumeration-2004_09.wsdl, the messages are defined as:
<wsdl:message name="ReleaseMessage">
<wsdl:part name="Body" element="wsen:Release"/>
</wsdl:message>
<wsdl:message name="ReleaseResponseMessage"/>
But, when I run wsdl2java, I get the following error:
An exception was caught: [ID = 'NotDocLiteral'] The WSDL operation
'ReleaseOp' is not doc-literal be
cause it defines a message with more than one message part for its SOAP
Body. The SOAP Body of a doc
-literal message should contain one root request element (with the
operation name) with zero or more
child elements (the parameters).
I suspect the issue is because the ReleaseResponseMessage element is
defined without a body (i.e. the response xml will have no body), but
wsdl2java expects a <wsdl:part> in each message element.
Do all message elements need a <wsdl:part>, even if it is empty? If so,
then WS-Enumeration-2004_09.wsdl is malformed. If not, wsdl2java needs
to be updated to properly handle empty message elements.