XmlSchemaComplexType methodSchemaType;
XmlSchemaSequence sequence = null;
for (int i = 0; i < declaredMethods.length; i++) {
JMethod jMethod = declaredMethods[i];
JAnnotation methodAnnon = jMethod.getAnnotation(AnnotationConstants.WEB_METHOD);
if (methodAnnon != null) {
if (methodAnnon.getValue(AnnotationConstants.EXCLUDE).asBoolean()) {
continue;
}
}
String methodName = getSimpleName(jMethod);
// no need to think abt this method , since that is system
// config method
if (excludeMethods.contains(methodName)) {
continue;
}
if (uniqueMethods.get(methodName) != null) {
log.warn("We don't support method overloading. Ignoring [" +
jMethod.getQualifiedName() + "]");
continue;
}
if (!jMethod.isPublic()) {
// no need to generate Schema for non public methods
continue;
}
boolean addToService = false;
AxisOperation axisOperation = service.getOperation(new QName(methodName));
if (axisOperation == null) {
axisOperation = Utils.getAxisOperationForJmethod(jMethod);
// if (WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(
// axisOperation.getMessageExchangePattern())){
// AxisMessage outMessage = axisOperation.getMessage(
// WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
// if (outMessage !=null ){
// outMessage.setName(methodName + RESPONSE);
// }
// }
addToService = true;
}
// Maintain a list of methods we actually work with
list.add(jMethod);
processException(jMethod,axisOperation);
uniqueMethods.put(methodName, jMethod);
JParameter[] paras = jMethod.getParameters();
String parameterNames[] = null;
AxisMessage inMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
if (inMessage != null) {
inMessage.setName(methodName + Java2WSDLConstants.MESSAGE_SUFFIX);
}
if (paras.length > 0) {
parameterNames = methodTable.getParameterNames(methodName);
sequence = new XmlSchemaSequence();
methodSchemaType = createSchemaTypeForMethodPart(methodName);
methodSchemaType.setParticle(sequence);
inMessage.setElementQName(typeTable.getQNamefortheType(methodName));
service.addMessageElementQNameToOperationMapping(methodSchemaType.getQName(),
axisOperation);
}
for (int j = 0; j < paras.length; j++) {
JParameter methodParameter = paras[j];
String parameterName = null;
JAnnotation paramterAnnon =
methodParameter.getAnnotation(AnnotationConstants.WEB_PARAM);
if (paramterAnnon != null) {
parameterName =
paramterAnnon.getValue(AnnotationConstants.NAME).asString();
}
if (parameterName == null || "".equals(parameterName)) {
parameterName = (parameterNames != null && parameterNames[j] != null) ?
parameterNames[j] : getSimpleName(methodParameter);
}
JClass paraType = methodParameter.getType();
if (nonRpcMethods.contains(getSimpleName(jMethod))) {
generateSchemaForType(sequence, null, getSimpleName(jMethod));
break;
} else {
generateSchemaForType(sequence, paraType, parameterName);
}
}
// for its return type
JClass returnType = jMethod.getReturnType();
if (!returnType.isVoidType()) {
String partQname = methodName + RESPONSE;
methodSchemaType =
createSchemaTypeForMethodPart(partQname);
sequence = new XmlSchemaSequence();
methodSchemaType.setParticle(sequence);
JAnnotation returnAnnon =
jMethod.getAnnotation(AnnotationConstants.WEB_RESULT);
String returnName = "return";
if (returnAnnon != null) {
returnName = returnAnnon.getValue(AnnotationConstants.NAME).asString();
if (returnName != null && !"".equals(returnName)) {
returnName = "return";
}
}
if (nonRpcMethods.contains(getSimpleName(jMethod))) {