protected List<JAXBElement<?>> createContentFromObject(final Object inputObject, String soapAction,
List<JAXBElement<?>> headerElements) {
List<Object> bodyParts = new ArrayList<Object>();
List<Object> headerParts = new ArrayList<Object>();
if (inputObject instanceof BeanInvocation) {
BeanInvocation bi = (BeanInvocation)inputObject;
Annotation[][] annotations = bi.getMethod().getParameterAnnotations();
List<WebParam> webParams = new ArrayList<WebParam>();
for (Annotation[] singleParameterAnnotations : annotations) {
for (Annotation annotation : singleParameterAnnotations) {
if (annotation instanceof WebParam) {
webParams.add((WebParam)annotation);
}
}
}
if (webParams.size() > 0) {
if (webParams.size() == bi.getArgs().length) {
int index = -1;
for (Object o : bi.getArgs()) {
if (webParams.get(++index).header()) {
headerParts.add(o);
} else {
bodyParts.add(o);
}
}
} else {
throw new RuntimeCamelException("The number of bean invocation parameters does not "
+ "match the number of parameters annotated with @WebParam for the method [ "
+ bi.getMethod().getName() + "].");
}
} else {
// try to map all objects for the body
for (Object o : bi.getArgs()) {
bodyParts.add(o);
}
}
} else {