boolean isRPC) {
List<PDElement> pdeList = new ArrayList<PDElement>();
int index = 0;
for (int i = 0; i < params.length; i++) {
ParameterDescription pd = params[i];
if (pd.getMode() == Mode.IN && isInput ||
pd.getMode() == Mode.INOUT ||
pd.getMode() == Mode.OUT && !isInput) {
// Get the matching signature argument
Object value = sigArguments[i];
// Don't consider async handlers, they are are not represented on the wire,
// thus they don't have a PDElement
if (isAsyncHandler(value)) {
continue;
}
// Convert from Holder into value
if (isHolder(value)) {
value = ((Holder)value).value;
}
// Get the formal type representing the value
Class formalType = pd.getParameterActualType();
// The namespace and local name are obtained differently depending on
// the style/use and header
QName qName = null;
if (pd.isHeader()) {
// Headers (even rpc) are marshalled with the name defined by the
// element= attribute on the wsd:part
qName = new QName(pd.getTargetNamespace(), pd.getParameterName());
} else if (isDocLitWrapped) {
// For doc/lit wrapped, the localName comes from the PartName
qName = new QName(pd.getTargetNamespace(), pd.getPartName());
} else if (isRPC) {
// Per WSI-BP, the namespace uri is unqualified
qName = new QName(pd.getPartName());
} else {
qName = new QName(pd.getTargetNamespace(), pd.getParameterName());
}
// Create an Element rendering
Element element = null;
AttachmentDescription attachmentDesc = pd.getAttachmentDescription();
if (attachmentDesc != null) {
PDElement pde = createPDElementForAttachment(pd, qName, value, formalType);
pdeList.add(pde);
} else {
if (!marshalDesc.getAnnotationDesc(formalType).hasXmlRootElement()) {
/* when a schema defines a SimpleType with xsd list jaxws tooling
* generates artifacts with array rather than a java.util.List
* However the ObjectFactory definition uses a List and thus
* marshalling fails. Lets convert the Arrays to List and recreate
* the JAXBElements for the same.
*/
if (pd.isListType()) {
List<Object> list = new ArrayList<Object>();
if (formalType.isArray()) {
for (int count = 0; count < Array.getLength(value); count++) {
Object obj = Array.get(value, count);