As stated in previous posts, the presence of SOAP headers in WSDLs used in
conjunction with Provider implementations causes body parts to be processed
as header parts.
The key seems to be matching up the index of the part/parts which define the
outbound SOAP body with location of the SOAP body in the MessageContentList.
Therefore I suggest adding code to the MessageModeOutInterceptor that finds
the index of the first SOAP body part and then inserts the SOAP body payload
into the MessageContentList at the same index as the part. The code for
doing this might look something like the code below. If these seems
appropriate, i can submit a patch containing this fix:

MessageModeOutInterceptorInternal.handleMessage()

            list.remove(0);
            DocumentFragment frag =
soapMessage.getSOAPPart().createDocumentFragment();
            try {
                Node body = soapMessage.getSOAPBody();
                Node nd = body.getFirstChild();
                while (nd != null) {
                    body.removeChild(nd);
                    frag.appendChild(nd);
                    nd = soapMessage.getSOAPBody().getFirstChild();
                }

                int index = 0;
                
                Exchange exchange = message.getExchange();
                BindingOperationInfo operation =
(BindingOperationInfo)exchange.get(BindingOperationInfo.class
                    .getName());

                List<MessagePartInfo> parts = null;
                BindingMessageInfo bmsg = null;
                boolean client = isRequestor(message);

                if (!client) {
                    if (operation.getOutput() != null) {
                        bmsg = operation.getOutput();
                        parts = bmsg.getMessageParts();
                    }
                } else {
                    bmsg = operation.getInput();
                    parts = bmsg.getMessageParts();
                }  
                
                if (parts != null && parts.size() > 0) {
                        index = parts.get(0).getIndex();
                }       
                                
                list.set(index, frag);

--
View this message in context: 
http://cxf.547215.n5.nabble.com/Response-SOAP-Headers-with-Provider-implementation-tp5485785p5498265.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Reply via email to