private void setHTTPSettings(WebServiceEntity entity) { if (httpBasicAuthUsername_ != null && httpBasicAuthPassword_ != null) { entity.setHTTPUsername(httpBasicAuthUsername_); entity.setHTTPPassword(httpBasicAuthPassword_); } }
public Object[] getElements(Object inputElement) { if (inputElement instanceof WebServicesParser) { WebServicesParser parser = (WebServicesParser)inputElement; Object wsEntity = parser.getWebServiceEntityByURI(webServiceURI); if (wsEntity != null) return new Object[] {wsEntity}; } return new Object[0]; }
public static final String[] parseQueryServiceURI(String uri) { return parseURI(QUERYSERVICE_URI_TEMPLATE,uri); } }
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; }
public boolean validate(String s) { String wsURI = s; if (wsURI.indexOf(':') < 0) { IFile file = uri2IFile(wsURI); if (file != null) wsURI = iFile2URI(file); } if (wsURI != null && wsURI.indexOf(':') >= 0 && webServicesParser.getWebServiceEntityByURI(wsURI) == null) { TimedWSDLSelectionConditionCommand cmd = new TimedWSDLSelectionConditionCommand(); cmd.setWebServicesParser(webServicesParser); cmd.setWebServiceURI(wsURI); cmd.execute(null, null); } // prime widget based on the string wsdlURI_ = wsURI; if (tree != null) tree.setWebServiceURI(wsURI); WebServiceEntity entity = webServicesParser.getWebServiceEntityByURI(wsURI); if (entity != null && entity.getType() == WebServiceEntity.TYPE_WSDL) return true; else return false; } }
public IStatus getStatus() { entity_ = getSelectionAsWebServiceEntity(); if (entity_ == null || entity_.getType() != WebServiceEntity.TYPE_WSDL) return StatusUtils.errorStatus( ConsumptionUIMessages.PAGE_MSG_SELECTION_MUST_BE_WSDL ); else return Status.OK_STATUS; }
public Object[] getChildren(Object parentElement) { if (parentElement instanceof WebServiceEntity) { List list = ((WebServiceEntity)parentElement).getChildren(); Object[] objects = new Object[list.size()]; for (int i = 0; i < objects.length; i++) objects[i] = list.get(i); return objects; } return new Object[0]; }
public void parse() throws MalformedURLException, IOException, ParserConfigurationException, SAXException, WWWAuthenticationException { parseURL(PARSE_WSIL | PARSE_WSDL | PARSE_LINKS | PARSE_DISCO); }
public Definition getWSDLDefinition(String wsdlURI) { try { return getWSDLDefinitionVerbose(wsdlURI); } catch (Exception t) { } return null; }
public String getWsdlURI() { if (entity_ != null) return entity_.getURI(); else return webServiceURI; }
/** * * @param wsilURI * @return * @throws MalformedURLException * @throws IOException * @throws WWWAuthenticationException * @throws WSILException * @deprecated replaced with getWSILDocumentVerbose(String, String) */ public WSILDocument getWSILDocumentVerbose(String wsilURI ) throws MalformedURLException, IOException, WWWAuthenticationException, WSILException { return getWSILDocumentVerbose( wsilURI, "UTF-8" ); }
public Object getParent(Object element) { if (element instanceof WebServiceEntity) return ((WebServiceEntity)element).getParent(); return new Object[0]; }
private void handleWebServiceURI(String wsURI) { if (wsURI.indexOf(':') < 0) { IFile file = uri2IFile(wsURI); if (file != null) wsURI = iFile2URI(file); } if (wsURI != null && wsURI.indexOf(':') >= 0 && webServicesParser.getWebServiceEntityByURI(wsURI) == null) { TimedWSDLSelectionConditionCommand cmd = new TimedWSDLSelectionConditionCommand(); cmd.setWebServicesParser(webServicesParser); cmd.setWebServiceURI(wsURI); cmd.execute(null, null); } WebServiceEntity entity = webServicesParser.getWebServiceEntityByURI(wsURI); if (entity != null && entity.getType() == WebServiceEntity.TYPE_WSDL) tree.setEnabled(false); else tree.setEnabled(true); tree.setWebServiceURI(wsURI); tree.refreshTreeViewer(); wsdlURI_ = wsURI; }
public Image getImage(Object element) { switch (((WebServiceEntity)element).getType()) { case WebServiceEntity.TYPE_HTML: return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/html.gif").createImage(); case WebServiceEntity.TYPE_WSIL: return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/wsil.gif").createImage(); case WebServiceEntity.TYPE_WSDL: return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/wsdl.gif").createImage(); default: return null; } }
public static final String[] parseServiceKeyURI(String uri) { return parseURI(SERVICEKEY_URI_TEMPLATE,uri); }
public void parse(int parseOption) throws MalformedURLException, IOException, ParserConfigurationException, SAXException, WWWAuthenticationException { parseURL(parseOption); }
private Definition parseWSDL(String wsdlURI) throws WSDLException, MalformedURLException, IOException, WWWAuthenticationException { return getWSDLDefinitionVerbose(wsdlURI); }
public String getText(Object element) { return ((WebServiceEntity)element).getURI(); }
/** * * @param wsilURI * @return * @deprecated replaced with getWSILDocumentVerbose(String, String) */ public WSILDocument getWSILDocument(String wsilURI ) { try { return getWSILDocumentVerbose(wsilURI, "UTF-8" ); } catch (Exception t) { } return null; }