Hi everyone,

Working with Camel-CXF Client endpoint I identified an issue which I cannot
bypass without building custom CXF interceptor.

Camel / Camel-Cxf version:  2.15.1.redhat-620133
CXF version: 3.0.4.redhat-620133

Scenario:

1. Camel-CXF endpoint: dataFormat=POJO

2. WS SEI method in Java:
-----------------------------------------------

public void performOperation(
        @WebParam(name = "inParam1", targetNamespace = "http://foo.com";)
        String inParam1,
        @WebParam(name = "inParam2",  targetNamespace = "http://foo.com";)
        String inParam2,
        @WebParam(mode = WebParam.Mode.OUT, name = "outParam",
targetNamespace = "http://tempuri.org/ODM_WS/Documents";)
        javax.xml.ws.Holder<String> outParam
    );

 note: OUT parameter is the last.

Issue:
 - When Camel message body (either MessageContentsList or Object[] ) has 3
elements for all 3 parts
then
org.apache.camel.component.cxf.CxfProducer throws exception when prepare
message to CXF

java.lang.IllegalArgumentException: Get the wrong parameter size to invoke
the out service, Expect size 2, Parameter size 3. Please check if the
message body matches the CXFEndpoint POJO Dataformat request.
        at
org.apache.camel.component.cxf.CxfProducer.checkParameterSize(CxfProducer.java:268)
        at
org.apache.camel.component.cxf.CxfProducer.getParams(CxfProducer.java:306)
        at 
org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:116)

- When Camel message body has two parts onli for IN and INOUT parameters
 CxfProducer is happy :), 
but CXF org.apache.cxf.jaxws.interceptors.HolderInInterceptor is not :(

when it processes received response and tries to set values back to the
holders exception is:

java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
        at java.util.ArrayList.rangeCheck(ArrayList.java:635)
        at java.util.ArrayList.get(ArrayList.java:411)
        at
org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:67)

---------------------------------------------
Issue is definitelly in Camel CxfProducer.
 When it checks parameters and build placeholders for them  to pass to CXF -
only input message parts counted:

org.apache.camel.component.cxf.CxfProducer line 246: 
int experctMessagePartsSize = boi.getInput().getMessageParts().size();

but guys... there are out parts for holders in boi.getOutput() as well and
CXF expects them...

--- 
as workaround I was able to plug CXF interceptor and add lost placeholders
to CXF message.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-CXF-javax-xml-ws-Holder-parts-issue-in-POJO-mode-tp5770726.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to