This looks like it was added as part of:

https://issues.apache.org/jira/browse/CXF-2837

which is a long time ago, but I think it’s wrong.   At the very least, it 
should grab the XmlSchemaElement from the part and check if the element is 
nillable or not and only skip if the element isn’t nillable.  

Dan



> On Jan 19, 2016, at 10:10 PM, Jim Ma <[email protected]> wrote:
> 
> Hi all,
> When I looked at a test case I found SoapOutInterceptor moves nillable
> header element to soap body when its value is set to null[1].  For example,
> when the following header part value is set to null, this nillable element
> will appear in soap body.
> 
> public String echo(@WebParam(name = "message") String message.
> 
>    @WebParam(name = "paramOut",mode = WebParam.Mode.INOUT, header = true)
> Holder<String> paramOut) {
>        paramOut.value = null;
>        return "echo: " + message;
>    }
> 
> <soap:Body><ns2:echoResponse xmlns:ns2="urn:echo"><result>echo:
> test</result></ns2:echoResponse><ns2:paramOut xmlns:ns2="urn:echo"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:nil="true"/></soap:Body>
> 
> Is this nillable element should be still put in soap header ? Is this an
> issue or any spec says  this should be handled like this ?
> 
> [1]
> https://github.com/apache/cxf/blob/master/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java#L237
> 
> Cheers,
> Jim

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to