public ExtensibilityElement unmarshall(Class parentType, QName elementType,
Element el, Definition def, ExtensionRegistry extReg)
throws WSDLException {
OperationType opType = new OperationType();
// Store the operation name
NamedNodeMap opAttributes = el.getAttributes();
for (int i = 0; i < opAttributes.getLength(); ++i) {
if (opAttributes.item(i).getNodeName().equals("name")) {
opType.setName(opAttributes.item(i).getNodeValue());
}
}
// Store the operations parameters, return value, and raises
NodeList opChildNodes = el.getChildNodes();
for (int i = 0; i < opChildNodes.getLength(); ++i) {
Node currentNode = opChildNodes.item(i);
if (currentNode.getNodeName().equals("corba:param")) {
ParamType param = new ParamType();
NamedNodeMap paramAttributes = currentNode.getAttributes();
for (int j = 0; j < paramAttributes.getLength(); ++j) {
Node paramAttrNode = paramAttributes.item(j);
if (paramAttrNode.getNodeName().equals("name")) {
param.setName(paramAttrNode.getNodeValue());
} else if (paramAttrNode.getNodeName().equals("mode")) {
param.setMode(ModeType.fromValue(paramAttrNode.getNodeValue()));
} else if (paramAttrNode.getNodeName().equals("idltype")) {
param.setIdltype(getIdlTypeName(def, paramAttrNode, currentNode));
}
}
opType.getParam().add(param);
} else if (currentNode.getNodeName().equals("corba:return")) {
ArgType ret = new ArgType();
NamedNodeMap retAttributes = currentNode.getAttributes();
for (int j = 0; j < retAttributes.getLength(); ++j) {
Node retAttrNode = retAttributes.item(j);
if (retAttrNode.getNodeName().equals("idltype")) {
ret.setIdltype(getIdlTypeName(def, retAttrNode, currentNode));
}
}
opType.setReturn(ret);
} else if (currentNode.getNodeName().equals("corba:raises")) {
RaisesType raises = new RaisesType();
NamedNodeMap raiseAttributes = currentNode.getAttributes();
for (int j = 0; j < raiseAttributes.getLength(); ++j) {
Node raiseAttrNode = raiseAttributes.item(j);
if (raiseAttrNode.getNodeName().equals("exception")) {
raises.setException(getIdlTypeName(def, raiseAttrNode, currentNode));
}
}
opType.getRaises().add(raises);
}
// anything else we are not interested in at the moment
}
return opType;
}