for (BeehiveWsParameterMetadata cpm : paraMeta) {
outParamMap.put(cpm.getWpName(), cpm);
}
}
}
BeehiveWsMethodMetadata wmm = new Jsr181MethodMetadataImpl(opName, returnType,
returnXMLType);
wmm.setWmOperationName(opName);
// FIXME jcolwell@bea.com 2004-Nov-10 --
// do something better with the action
wmm.setWmAction(opName);
if (Void.TYPE.equals(returnType)) {
if (paraMeta.length == 0) {
// FIXME jcolwell@bea.com 2004-Nov-22 --
// also check for faults before setting as oneway.
wmm.setOneWay(true);
}
} else {
wmm.setWrName(paraMeta[0].getWpName());
wmm.setWrTargetNamespace(paraMeta[0].getWpTargetNamespace());
}
methodMap.put(opName, wmm);
List paramOrder = op.getParameterOrder(); // this is the one used by
// rpc wsdls.
TParam inputParam = op.getInput();
if (inputParam != null) {
TPart[] messageParts = messageMap.get(inputParam.getMessage()
.getLocalPart());
BeehiveWsParameterMetadata[] params = processParameters(opName, messageParts, tBind, types,
messageMap, wsm, false);
if (paramOrder != null) {
// Paramorder is only used for rpc.
// if there is a paramoder then order the parameters, remove all the in/out parameters
// from the out map
for (Object ord : paramOrder) {
for (BeehiveWsParameterMetadata wpm : params) {
if (ord.equals(wpm.getWpName())) {
if (outParamMap != null && outParamMap.containsKey(wpm.getWpName())) {
outParamMap.remove(wpm.getWpName()); // important...
// if this param is in.out it was in the out list
// also, so removeit.
wpm.setWpMode(WebParam.Mode.INOUT);
} else {
wpm.setWpMode(WebParam.Mode.IN);
}
wmm.addParam(wpm);
break;
}
}
}
} else if (params.length > 0) {
for (BeehiveWsParameterMetadata wpm : params) {
// FIXME jcolwell@bea.com 2005-Jan-04 --
// Double check DOC/Lit rules
if (outParamMap != null && outParamMap.containsKey(wpm.getWpName())) {
outParamMap.remove(wpm.getWpName()); // important...
// if
// this param is
// in.out it was
// in the out list
// also, so remove
// it.
wpm.setWpMode(WebParam.Mode.INOUT);
} else {
wpm.setWpMode(WebParam.Mode.IN);
}
wmm.addParam(wpm);
}
}
}
// do the pure out parameters.
if (outParamMap != null && outParamMap.size() > 0) {
if (outParamMap.size() == 1) {
BeehiveWsParameterMetadata wpm = outParamMap.values().iterator().next();
wmm.setXmlReturnType(wpm.getXmlType());
wmm.setReturnType(wpm.getJavaType());
wmm.setOneWay(false);
} else {
for (BeehiveWsParameterMetadata wpm : outParamMap.values()) {
wpm.setWpMode(WebParam.Mode.OUT);
wmm.addParam(wpm);
}
}
}