You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2011/03/31 13:23:05 UTC

[jira] [Resolved] (CXF-3433) RPCOutInterceptor naively appends "Response" to the request message name for a response message name

     [ https://issues.apache.org/jira/browse/CXF-3433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-3433.
------------------------------

       Resolution: Not A Problem
    Fix Version/s: Invalid


This is currently working per spec.   The RPCOutInterceptor is used for "RPC-literal" style interactions.   Per WSI-Basic Profil, section 4.7.10:

"Conversely, in a rpc-literal SOAP binding, the serialized child element of the soap:Body element consists of a wrapper element, whose namespace is the value of the namespace attribute of the soapbind:body element and whose local name is either the name of the operation or the name of the operation suffixed with "Response". The namespace attribute is required, as opposed to being optional, to ensure that the children of the soap:Body element are namespace-qualified."

For RPC-literal, there is no way to control the element name for the direct child of the soap:body.   The block above covers it.



> 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.1, 2.3.2, 2.3.3
>         Environment: N/A
>            Reporter: Burton Alexander
>            Priority: Minor
>              Labels: RPCOutInterceptor, name, response
>             Fix For: Invalid
>
>
> 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