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

RPCOutInterceptor naively appends "Response" to the request message name for a response message name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 2.3.1, 2.3.2, 2.3.3
    • Invalid
    • Core
    • N/A

    Description

      The existing code in org.apache.cxf.binding.soap.interceptor.RPCOutInterceptor appends "Response" as a suffix to a request message element name for the response name, ignoring the defined name in the associated WSDL. I've implemented the following fix for our environment:

      protected String addOperationNode(NSStack nsStack, Message message, XMLStreamWriter xmlWriter, boolean output, BindingOperationInfo boi) throws XMLStreamException {
      String ns = boi.getName().getNamespaceURI();
      SoapBody body = null;
      if (output)

      { body = boi.getOutput().getExtensor(SoapBody.class); }

      else

      { body = boi.getInput().getExtensor(SoapBody.class); }

      if (body != null && !StringUtils.isEmpty(body.getNamespaceURI()))

      { ns = body.getNamespaceURI(); }

      nsStack.add(ns);
      String prefix = nsStack.getPrefix(ns);
      // Fixes the name problem
      String name = getName(boi, output);
      StaxUtils.writeStartElement(xmlWriter, prefix, name, ns);
      return ns;
      }

      private String getName(BindingOperationInfo boi, boolean output) {
      if (!output)

      { return boi.getName().getLocalPart(); }

      return boi.getOutput().getMessageInfo().getName().getLocalPart();
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            balexander Burton Alexander
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: