cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Response SOAP Headers with Provider implementation
Date Tue, 21 Feb 2012 22:23:32 GMT
On Sunday, February 19, 2012 10:05:01 PM Seumas Soltysik wrote:
> 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:

Can you log a JIRA for this?    A test case would be great.

There may be another way to handle this by registering an interceptor just 
prior to the write phase that flips out the OperationInfo with the synthetic 
"invoke" operation, but I'd have to play with that a bit more.

Dan


> 
> 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-impleme
> ntation-tp5485785p5498265.html Sent from the cxf-dev mailing list archive at
> Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Mime
View raw message