public static ISchema getDefaultSchema(final Description description) { final Definition definition = description.getComponent(); final String targetNamespace = definition.getTargetNamespace(); final ISchema[] schemas = description.getSchema(targetNamespace); ISchema schema = null; if (schemas != null && schemas.length > 0) { schema = schemas[0]; } return schema; }
@Override public IStatus run(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { final ServiceOperation component = (ServiceOperation) modelObject; final Operation operation = component.getComponent(); Fault wsdlFault = fault.getComponent(); if (null == wsdlFault || !operation.getEFaults().contains(wsdlFault)) { return new Status( IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format( Messages.DeleteFaultCommand_msg_can_not_find_fault_component_for_X, fault.getName())); } Description description = (Description) getModelRoot().getDescription(); WSDLAnalyzer wsdlAnalyzer = new WSDLAnalyzer(description.getComponent()); ServiceInterface serviceInterface = (ServiceInterface) component.getParent(); wsdlAnalyzer.removeFaultBindings(serviceInterface.getComponent(), operation, wsdlFault); // Remove faults from the EMF model as well operation.getEFaults().remove(wsdlFault); return Status.OK_STATUS; }