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

Dispatch client fails to set WS-Addressing Action header when WSDL's soap:operation does not have a style attribute

    XMLWordPrintableJSON

Details

    • Novice

    Description

      I found the cause of the problem to be a bug in this method in CXF (I have version 2.4.1):
      private Map<String, QName> createPayloadEleOpNameMap(BindingInfo bindingInfo) {
      Map<String, QName> payloadElementMap = new java.util.HashMap<String, QName>();
      for (BindingOperationInfo bop : bindingInfo.getOperations()) {
      SoapOperationInfo soi = (SoapOperationInfo)bop.getExtensor(SoapOperationInfo.class);
      if (soi != null) {
      if ("document".equals(soi.getStyle())) {
      // if doc
      if (bop.getOperationInfo().getInput() != null
      && !bop.getOperationInfo().getInput().getMessageParts().isEmpty())

      { QName qn = bop.getOperationInfo().getInput().getMessagePartByIndex(0) .getElementQName(); payloadElementMap.put(qn.toString(), bop.getOperationInfo().getName()); }

      } else if ("rpc".equals(soi.getStyle()))

      { // if rpc payloadElementMap.put(bop.getOperationInfo().getName().toString(), bop.getOperationInfo() .getName()); }

      }
      }
      return payloadElementMap;
      }

      The problem is that it requires the SoapOperationInfo to have a style attribute, but in the W3C spec for WSDL it says the style attribute on the soap operation is optional, specifically 'If the attribute is not specified, it defaults to the value specified in the soap:binding element. If the soap:binding element does not specify a style, it is assumed to be "document".' So the code needs to check if the soi has a style and if not read it from the binding and if not then set it as "document". This is not a problem in the WSDLs generated by CXF (as I found out with a HelloWorld test) because it creates these optional style attributes, but since W3C says people can generate WSDLs without these (and I ran into one) I think it's worth fixing.

      Attachments

        1. patch3747.txt
          2 kB
          Jesse Pangburn
        2. patch3747and3748.txt
          3 kB
          Jesse Pangburn

        Activity

          People

            dkulp Daniel Kulp
            jpangburn Jesse Pangburn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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