public List getWsdlServicesFromWsilFile(IFile wsil) { List result = new ArrayList(); WebServiceEntity entity = parseWsilFile(wsil); if (entity != null && entity.getType() == WebServiceEntity.TYPE_WSIL) { // get all the WSDL references from the WSIL entity List wsdlList = entity.getChildren(); for (Iterator it = wsdlList.iterator(); it.hasNext();) { Object item = it.next(); if (item != null && item instanceof WebServiceEntity) { if (((WebServiceEntity) item).getModel() != null && ((WebServiceEntity) item).getModel() instanceof Definition) { Definition def = (Definition) ((WebServiceEntity) item).getModel(); if (def != null && !def.getServices().isEmpty()) result.addAll(def.getServices().values()); } } } } return result; } public WebServiceEntity parseWsilFile(IFile wsil) {
public Definition getWSDLDefinitionVerbose(String wsdlURI) throws MalformedURLException, IOException, WWWAuthenticationException, WSDLException { WebServiceEntity wsEntity = getWebServiceEntityByURI(wsdlURI); if (wsEntity == null) { wsEntity = new WebServiceEntity(); wsEntity.setURI(wsdlURI); uriToEntityTable_.put(wsdlURI, wsEntity); } Definition definition = (Definition)wsEntity.getModel(); if (definition == null) { byte[] b = getInputStreamAsByteArray(wsdlURI); wsEntity.setBytes(b); setHTTPSettings(wsEntity); ByteArrayInputStream bais = new ByteArrayInputStream(b); WSDLFactory factory = WSDLPlugin.INSTANCE.createWSDL4JFactory(); WSDLReader wsdlReader = factory.newWSDLReader(); definition = wsdlReader.readWSDL(wsdlURI, new InputSource(bais)); wsEntity.setType(WebServiceEntity.TYPE_WSDL); wsEntity.setModel(definition); } return definition; }
WSILDocument wsilDocument = (WSILDocument)wsEntity.getModel();
private void parseWSIL(String wsilURI, int parseOption, String byteEncoding ) throws WSILException, MalformedURLException, IOException, WSDLException, WWWAuthenticationException WSILDocument wsilDoc = (WSILDocument)wsilEntity.getModel(); if (wsilDoc != null)