use of org.apache.cxf.tools.corba.common.idltypes.IdlModule in project cxf by apache.
the class WSDLToIDLAction method generateIDL.
private void generateIDL(Definition definition, Binding binding) {
List<?> ext = binding.getExtensibilityElements();
if (!(ext.get(0) instanceof BindingType)) {
// throw an error not a corba binding
throw new RuntimeException(binding.getQName() + " is not a corba binding, " + "please pass a corba binding/porttype to use");
}
String[] nm = unscopeName(binding.getPortType().getQName().getLocalPart());
int pos = nm[nm.length - 1].lastIndexOf("Binding");
if (pos != -1) {
nm[nm.length - 1] = nm[nm.length - 1].substring(0, pos);
}
IdlScopeBase parent = root;
if (nm.length > 1) {
for (int i = 0; i < nm.length - 1; ++i) {
IdlModule mod = IdlModule.create(parent, nm[i]);
parent.addToScope(mod);
parent = mod;
}
}
intf = IdlInterface.create(parent, nm[nm.length - 1]);
parent.holdForScope(intf);
try {
getAllIdlTypes();
collectIdlDefns(binding);
root.flush();
} catch (Exception ex) {
ex.printStackTrace();
}
parent.promoteHeldToScope();
root.write(printWriter);
}
Aggregations