Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-416

WSDL2Java generates bad code for oneway operations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.94
    • 0.95
    • Tools
    • None
    • Any

    Description

      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.

      Attachments

        Activity

          People

            ajith Ajith Ranabahu
            rnaranjo Rubén Naranjo Izquierdo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: