if (name == null)
name = new QName(localName);
Type type = JAXBUtil.getActualParameterType(genericParams[i]);
Property property = _jaxbContext.createProperty(type, true);
ParameterMarshal pMarshal
= ParameterMarshal.create(i, property, name, mode,
marshaller, unmarshaller);
if (isHeader) {
if (pMarshal instanceof InParameterMarshal)
_headerInputs++;
else if (pMarshal instanceof OutParameterMarshal)
_headerOutputs++;
else {
_headerInputs++;
_headerOutputs++;
}
headerList.add(pMarshal);
_headerArguments.put(localName, pMarshal);
}
else if (isAttachment) {
if (! (property instanceof AttachmentProperty))
throw new WebServiceException(L.l("Argument {0} of method {1} is of type {2}: Attachment argument types must map to base64Binary", i, method.getName(), params[i]));
if (pMarshal instanceof InParameterMarshal)
_attachmentInputs++;
else if (pMarshal instanceof OutParameterMarshal)
_attachmentOutputs++;
else {
_attachmentInputs++;
_attachmentOutputs++;
}
attachmentList.add(pMarshal);
_attachmentArguments.put(localName, pMarshal);
}
else {
if (pMarshal instanceof InParameterMarshal)
_bodyInputs++;
else if (pMarshal instanceof OutParameterMarshal)
_bodyOutputs++;
else {
_bodyInputs++;
_bodyOutputs++;
}
bodyList.add(pMarshal);
_bodyArguments.put(localName, pMarshal);
}
}
_attachmentArgs = new ParameterMarshal[attachmentList.size()];
attachmentList.toArray(_attachmentArgs);
_headerArgs = new ParameterMarshal[headerList.size()];
headerList.toArray(_headerArgs);
_bodyArgs = new ParameterMarshal[bodyList.size()];
bodyList.toArray(_bodyArgs);
//
// Return type
//
if (! Void.TYPE.equals(method.getReturnType())) {
if (_isOneway)
throw new WebServiceException(L.l("Method {0} annotated with @Oneway, but has non-void return", method.getName()));
Property property =
_jaxbContext.createProperty(method.getGenericReturnType());
WebResult webResult = method.getAnnotation(WebResult.class);
if (webResult == null && eiMethod != null)
webResult = eiMethod.getAnnotation(WebResult.class);
if (webResult != null) {
_headerReturn = webResult.header();
String localName = webResult.name();
if ("".equals(localName))
localName = "return";
if ("".equals(webResult.targetNamespace()))
_resultName = new QName(localName);
else
_resultName = new QName(webResult.targetNamespace(), localName);
}
else {
_headerReturn = false;
_resultName = new QName("return"); // XXX namespace?
}
_returnMarshal = ParameterMarshal.create(0, property, _resultName,
WebParam.Mode.OUT,
marshaller, unmarshaller);
_bodyOutputs++;
if (_headerReturn)
_headerOutputs++;
}
else {
_headerReturn = false;
_returnMarshal = null;
}
//
// Exceptions
//
Class[] exceptions = method.getExceptionTypes();
for (Class exception : exceptions) {
QName faultName = new QName(targetNamespace,
exception.getSimpleName(),
TARGET_NAMESPACE_PREFIX);
// XXX check for generated exception classes versus raw exceptions
// i.e. things like getFaultInfo()
Property property = jaxbContext.createProperty(exception);
ParameterMarshal marshal =
ParameterMarshal.create(0, property, faultName,
WebParam.Mode.OUT,
marshaller, unmarshaller);