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

                 Key: CXF-3433
                 URL: https://issues.apache.org/jira/browse/CXF-3433
             Project: CXF
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.3.3, 2.3.2, 2.3.1
         Environment: N/A
            Reporter: Burton Alexander
            Priority: Minor


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();
}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to