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

WSDL11ToAxisServiceBuilder.getMEP(Operation) doesn't always return the correct MEP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4
    • None
    • deployment, wsdl
    • None

    Description

      If you want to define a Robust-In-Only operation in WSDL 1.1 you can't just define a <wsdl:operation> in a <wsdl:portType> that only has a <wsdl:input> and a <wsdl:fault>. The schema says that you have to also define a <wsdl:output> tag, which then gets mapped to an empty <wsdl:message> element.

      Because the operation now has a <wsdl:input> and also a <wsdl:output>, this causes the WSDL parser to set the operation style to REQUEST-RESPONSE instead of ONE-WAY. This might seem to be an issue with the WSDL parser, but one could make the argument that WSDL 1.1 doesn't support the Robust-In-Only MEP. However, it seems that the Axis2 code has been written to account for it anyway.

      Rather then just relying on the Operation.getStyle() method to determine the MEP, the WSDL11ToAxisServiceBuilder.getMEP(Operation) method should be looking at the Message Parts within the Input and Output to determine the correct MEP. Maybe something similar to this:

      private String getMEP(Operation operation) throws AxisFault {
      OperationType operationType = operation.getStyle();
      if (isServerSide) {
      if (operationType != null) {
      if (operationType.equals(OperationType.REQUEST_RESPONSE)) {
      //Fix for AXIS2-4559
      //Check if it's really One-Way
      if(operation.getOutput().getMessage().getParts().isEmpty()){
      if(operation.getFaults().size() > 0)

      { return WSDL2Constants.MEP_URI_ROBUST_IN_ONLY; }

      return WSDL2Constants.MEP_URI_IN_ONLY;
      }
      //End Fix for AXIS2-4559
      return WSDL2Constants.MEP_URI_IN_OUT;
      }

      if (operationType.equals(OperationType.ONE_WAY)) {
      if (operation.getFaults().size() > 0)

      { return WSDL2Constants.MEP_URI_ROBUST_IN_ONLY; }

      return WSDL2Constants.MEP_URI_IN_ONLY;
      }

      if (operationType.equals(OperationType.NOTIFICATION))

      { return WSDL2Constants.MEP_URI_OUT_ONLY; }

      if (operationType.equals(OperationType.SOLICIT_RESPONSE))

      { return WSDL2Constants.MEP_URI_OUT_IN; }

      throw new AxisFault("Cannot Determine the MEP");
      }
      } else {
      if (operationType != null) {
      if (operationType.equals(OperationType.REQUEST_RESPONSE)) {
      //Fix for AXIS2-4559
      if(operation.getOutput().getMessage().getParts().isEmpty()){
      if(operation.getFaults().size() > 0)

      { return WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY; }

      return WSDL2Constants.MEP_URI_OUT_ONLY;
      }
      //End Fix for AXIS2-4559
      return WSDL2Constants.MEP_URI_OUT_IN;
      }

      if (operationType.equals(OperationType.ONE_WAY)) {
      //Fix for AXIS2-4559
      if (operation.getFaults().size() > 0)

      { return WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY; }

      //End Fix for AXIS2-4559
      return WSDL2Constants.MEP_URI_OUT_ONLY;
      }

      if (operationType.equals(OperationType.NOTIFICATION))

      { return WSDL2Constants.MEP_URI_IN_ONLY; }

      if (operationType.equals(OperationType.SOLICIT_RESPONSE))

      { return WSDL2Constants.MEP_URI_IN_OUT; }

      throw new AxisFault("Cannot Determine the MEP");
      }
      }
      throw new AxisFault("Cannot Determine the MEP");
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            breif Ben Reif
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: