WSDL2Java generates bad code for oneway operations
--------------------------------------------------
Key: AXIS2-416
URL: http://issues.apache.org/jira/browse/AXIS2-416
Project: Apache Axis 2.0 (Axis2)
Type: Bug
Components: Tools
Versions: 0.94
Environment: Any
Reporter: Rubén Naranjo Izquierdo
If we have a wsdl with an operation like this (Where "tns:SimpleMessage" may
be just a "xsd:string"):
<wsdl:portType name="SimplePortType">
<wsdl:operation name="SimpleOperation">
<wsdl:input message="tns:SimpleMessage"/>
</wsdl:operation>
</wsdl:portType>
WSDL2Java generates a Message Receiver that extends
"AbstractInOutSyncMessageReceiver" instead of "AbstractInMessageReceiver":
public class SimplePortTypeMessageReceiver extends
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver { ... }
Also, in the Stub, operations are registered as "OutInAxisOperation",
instead of "InOnlyAxisOperation":
_operations = new org.apache.axis2.description.OutInAxisOperation[1];
Any attept to use the stub to comunicate with the service will result in the
following exception:
org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: Raw Xml provider
supports only the methods bearing the signature public OMElement
<method-name>(OMElement) where the method name can be anything
at
org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver.invokeBusinessLogic(RawXMLINOnlyMessageReceiver.java:118)
at
org.apache.axis2.receivers.AbstractInMessageReceiver.receive(AbstractInMessageReceiver.java:34)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:331)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:274)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:150)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
If we add an output message to the operation, then everything works
perfectly (but the operation isn't oneway any more):
<wsdl:portType name="SimplePortType">
<wsdl:operation name="SimpleOperation">
<wsdl:input message="tns:SimpleMessage"/>
<wsdl:output message="tns:SimpleMessage"/>
</wsdl:operation>
</wsdl:portType>
Trying to manually change Message Receiver generated, so it extends
"AbstractInMessageReceiver" results in more exceptions difficult to solve.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira