use of javax.wsdl.Operation in project tesb-studio-se by Talend.
the class OpenWSDLPage method populateModelFromWsdl.
@SuppressWarnings({ "unchecked" })
private static void populateModelFromWsdl(IProxyRepositoryFactory factory, Definition definition, ServiceItem serviceItem, RepositoryNode serviceRepositoryNode) throws CoreException {
serviceRepositoryNode.getChildren().clear();
((ServiceConnection) serviceItem.getConnection()).getServicePort().clear();
for (PortType portType : (Collection<PortType>) definition.getAllPortTypes().values()) {
ServicePort port = ServicesFactory.eINSTANCE.createServicePort();
port.setId(factory.getNextId());
port.setName(portType.getQName().getLocalPart());
for (Operation operation : (Collection<Operation>) portType.getOperations()) {
String operationName = operation.getName();
ServiceOperation serviceOperation = ServicesFactory.eINSTANCE.createServiceOperation();
serviceOperation.setId(factory.getNextId());
RepositoryNode operationNode = new RepositoryNode(new RepositoryViewObject(serviceItem.getProperty()), serviceRepositoryNode, ENodeType.REPOSITORY_ELEMENT);
operationNode.setProperties(EProperties.LABEL, serviceItem.getProperty().getLabel());
operationNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.SERVICESOPERATION);
serviceOperation.setName(operationName);
if (operation.getDocumentationElement() != null) {
serviceOperation.setDocumentation(operation.getDocumentationElement().getTextContent());
}
serviceOperation.setLabel(operationName);
serviceOperation.setInBinding(WSDLUtils.isOperationInBinding(definition, port.getName(), operationName));
port.getServiceOperation().add(serviceOperation);
}
((ServiceConnection) serviceItem.getConnection()).getServicePort().add(port);
}
}
use of javax.wsdl.Operation in project tomee by apache.
the class WsdlVisitor method walkTree.
public void walkTree() {
begin();
try {
visit(definition);
for (Iterator iterator = definition.getImports().entrySet().iterator(); iterator.hasNext(); ) {
Map.Entry entry = (Map.Entry) iterator.next();
String namespaceURI = (String) entry.getKey();
List importsForNamespace = (List) entry.getValue();
for (Iterator iterator1 = importsForNamespace.iterator(); iterator1.hasNext(); ) {
Import anImport = (Import) iterator1.next();
visit(anImport);
}
}
visit(definition.getTypes());
Collection messages = definition.getMessages().values();
for (Iterator iterator = messages.iterator(); iterator.hasNext(); ) {
Message message = (Message) iterator.next();
visit(message);
Collection parts = message.getParts().values();
for (Iterator iterator2 = parts.iterator(); iterator2.hasNext(); ) {
Part part = (Part) iterator2.next();
visit(part);
}
}
Collection services = definition.getServices().values();
for (Iterator iterator = services.iterator(); iterator.hasNext(); ) {
Service service = (Service) iterator.next();
visit(service);
Collection ports = service.getPorts().values();
for (Iterator iterator1 = ports.iterator(); iterator1.hasNext(); ) {
Port port = (Port) iterator1.next();
visit(port);
Binding binding = port.getBinding();
visit(binding);
List bindingOperations = binding.getBindingOperations();
for (int i = 0; i < bindingOperations.size(); i++) {
BindingOperation bindingOperation = (BindingOperation) bindingOperations.get(i);
visit(bindingOperation);
visit(bindingOperation.getBindingInput());
visit(bindingOperation.getBindingOutput());
Collection bindingFaults = bindingOperation.getBindingFaults().values();
for (Iterator iterator2 = bindingFaults.iterator(); iterator2.hasNext(); ) {
BindingFault bindingFault = (BindingFault) iterator2.next();
visit(bindingFault);
}
}
PortType portType = binding.getPortType();
visit(portType);
List operations = portType.getOperations();
for (int i = 0; i < operations.size(); i++) {
Operation operation = (Operation) operations.get(i);
visit(operation);
{
Input input = operation.getInput();
visit(input);
}
{
Output output = operation.getOutput();
visit(output);
}
Collection faults = operation.getFaults().values();
for (Iterator iterator2 = faults.iterator(); iterator2.hasNext(); ) {
Fault fault = (Fault) iterator2.next();
visit(fault);
}
}
}
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
} finally {
end();
}
}
Aggregations