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

soap:fault element not recognized for soap 1.2 binding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4
    • None
    • WSDL processing
    • None
    • JDK 1.4.2
      Windows XP

    Description

      When you have a soap 1.2 binding with soap fault, the fault element is not correctly extracted, resulting in error

      ERROR: Missing <soap:fault> element inFault "..." in operation "...", in binding ...

      This is caused by the missing statement that sets the local variable foundSOAPFault in the faultsFromSOAPFault method of the org.apache.axis.wsdl.symbolTable.SymbolTable class.

      In particular, the current 1.4 code shows:

      if (obj instanceof SOAPFault)

      { foundSOAPFault = true; soapFaultUse = ((SOAPFault) obj).getUse(); soapFaultNamespace = ((SOAPFault) obj).getNamespaceURI(); break; }

      else if (obj instanceof UnknownExtensibilityElement) {

      // TODO: After WSDL4J supports soap12, change this code
      UnknownExtensibilityElement unkElement =
      (UnknownExtensibilityElement) obj;
      QName name =
      unkElement.getElementType();

      if (name.getNamespaceURI().equals(Constants.URI_WSDL12_SOAP)
      && name.getLocalPart().equals("fault")) {
      if (unkElement.getElement().getAttribute("use")
      != null)

      { soapFaultUse = unkElement.getElement().getAttribute("use"); }

      if (unkElement.getElement().getAttribute("namespace")
      != null) { soapFaultNamespace = unkElement.getElement().getAttribute( "namespace"); }
      }
      }
      }

      // Check to make sure we have a soap:fault element
      if (!foundSOAPFault) { throw new IOException( Messages.getMessage( "missingSoapFault00", faultName, bindOp.getName(), binding.getQName().toString())); }

      Note that variable foundSOAPFault is not set for the SOAP 1.2 binding. This causes a WSDL with soap fault to throw an missingSoapFault00 exception.

      Adding the statement foundSOAPFault = true, as shown below, will fix this problem.
      ...
      } else if (obj instanceof UnknownExtensibilityElement) {

      // TODO: After WSDL4J supports soap12, change this code
      UnknownExtensibilityElement unkElement =
      (UnknownExtensibilityElement) obj;
      QName name =
      unkElement.getElementType();

      if (name.getNamespaceURI().equals(Constants.URI_WSDL12_SOAP)
      && name.getLocalPart().equals("fault")) {
      foundSOAPFault = true;
      if (unkElement.getElement().getAttribute("use")
      != null) { soapFaultUse = unkElement.getElement().getAttribute("use"); }

      if (unkElement.getElement().getAttribute("namespace")
      != null)

      { soapFaultNamespace = unkElement.getElement().getAttribute( "namespace"); }

      }
      }
      ...

      Attachments

        1. SymbolTable.java
          137 kB
          Akitoshi Yoshida
        2. test.wsdl
          3 kB
          Akitoshi Yoshida

        Activity

          People

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

            Dates

              Created:
              Updated: