Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2734

RPCProvider's getBody does not work for SOAPBodyElement with null parameter argument

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4
    • None
    • Basic Architecture
    • None
    • JDK 1.4, Win XP

    Description

      org.apache.axis.providers.java.RPCProvider's getBody is suposed to return an RPCElement.
      When the actual SOAP body contains the plain SOAPBodyElement and not the RPCElement, it instantiates an RPCElement with the content of the SOAPBodyElement. But this code does not work when the operation has no parameter, as param is returned as null to skip the body creation block.

      if (!(bodies.get(bNum) instanceof RPCElement)) {
      SOAPBodyElement bodyEl = (SOAPBodyElement) bodies.get(bNum);
      // igors: better check if bodyEl.getID() != null
      // to make sure this loop does not step on SOAP-ENC objects
      // that follow the parameters! FIXME?
      if (bodyEl.isRoot() && operation != null && bodyEl.getID() == null) {
      ParameterDesc param = operation.getParameter(bNum);
      // at least do not step on non-existent parameters!
      if (param != null) {
      Object val = bodyEl.getValueAsType(param.getTypeQName());
      body = new RPCElement("",
      operation.getName(),
      new Object[]

      {val});
      }
      }
      } else {


      In order to fix this problem, the above code needs to be modified to:

      if (!(bodies.get(bNum) instanceof RPCElement)) {
      SOAPBodyElement bodyEl = (SOAPBodyElement) bodies.get(bNum);
      // igors: better check if bodyEl.getID() != null
      // to make sure this loop does not step on SOAP-ENC objects
      // that follow the parameters! FIXME?
      if (bodyEl.isRoot() && operation != null && bodyEl.getID() == null) {
      ParameterDesc param = operation.getParameter(bNum);
      // at least do not step on non-existent parameters!
      QName qname = operation.getElementQName();
      if (param != null) {
      Object val = bodyEl.getValueAsType(param.getTypeQName());
      body = new RPCElement(qname.getNamespaceURI(),
      qname.getLocalPart(),
      new Object[]{val}

      );
      } else {
      body = new RPCElement(qname.getNamespaceURI(),
      qname.getLocalPart(),
      new Object[]{});
      }
      }
      } else {

      Attachments

        Activity

          People

            Unassigned Unassigned
            ay Akitoshi Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified