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

Add methods to get input and output SOAP headers to SOAPBindingUtil

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 2.7.12, 3.0.1
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      SOAPBindingUtil has methods to get the first input and output SOAP header for a BindingOperation.
      Add methods to get list of all the headers.

      The method getSoapHeaders(List<ExtensibilityElement> exts) cannot be used as the BindingOperation.getBindingInput().getExtensibilityElements() and BindingOperation.getBindingOutput().getExtensibilityElements() returns List<Object> and not List<ExtensibilityElement> which cannot safely be casted to List<ExtensibilityElement> without checking the type of each element in the list (...getExtensibilityElements() instanceof List<ExtensibilityElement> not legal with Java generics).

      org.apache.cxf.binding.soap.SOAPBindingUtil
          public static List<SoapHeader> getBindingInputSOAPHeaders(BindingOperation bop) {
              List<SoapHeader> headers = new ArrayList<SoapHeader>();
              BindingInput bindingInput = bop.getBindingInput();
              if (bindingInput != null) {
                  for (Object obj : bindingInput.getExtensibilityElements()) {
                      if (isSOAPHeader(obj)) {
                          headers.add(getProxy(SoapHeader.class, obj));
                      }
                  }
              }
              return headers;
          }
      
          public static List<SoapHeader> getBindingOutputSOAPHeaders(BindingOperation bop) {
              List<SoapHeader> headers = new ArrayList<SoapHeader>();
              BindingOutput bindingOutput = bop.getBindingOutput();
              if (bindingOutput != null) {
                  for (Object obj : bindingOutput.getExtensibilityElements()) {
                      if (isSOAPHeader(obj)) {
                          headers.add(getProxy(SoapHeader.class, obj));
                      }
                  }
              }
              return headers;
          }
      

        Attachments

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              pfrandsen Peter Frandsen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: