Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8587

Don't check the validation flag and get the schema on every iteration for SoapHeader

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4.4, 3.3.11
    • 3.5.0, 3.3.12, 3.4.5
    • Soap Binding
    • None
    • Unknown

    Description

      It seems like we don't need to check the schema enabled flag and get schema on every iteration for a SoapHeder.

      for (SoapHeaderInfo header : headers) {
          MessagePartInfo mpi = header.getPart();
          try {
              if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.IN, message)) {
                  Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0), message
                                                                   .getExchange().getBus());
                  validateHeader(message, mpi, schema);
              }
          } catch (Fault f) {
              if (!isRequestor(message)) {
                  f.setFaultCode(Fault.FAULT_CODE_CLIENT);
              }
              throw f;
          }
          ...
      }

      Removing these actions outside of the loop can provide a slight performance improvement if multiple headers are present in a request.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Ilya Mikhailov Ilya Mikhailov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: