问题
I recently came across this issue when trying to pass an XML to a Cxf Webservice within apache Camel.
Caused by: java.lang.IllegalArgumentException: Get the wrong parameter size to invoke the out service, Expect size 1, Parameter size 2. Please check if the message body matches the CXFEndpoint POJO Dataformat request.
at org.apache.camel.component.cxf.CxfProducer.checkParameterSize(CxfProducer.java:241)
One of the XML tags included a comma, which seems to be the issue.
回答1:
As it turned out, I was passing the XML as a string in the body of the exchange. But the CxfProducer (in the POJO data format) expects a List. If it's not the case it parses the String and the comma gets interpreted as a list separator.
I hope it will help someone else as well!
来源:https://stackoverflow.com/questions/24032319/cxf-camel-illegalargumentexception-get-the-wrong-parameter-size-to-invoke-t