/**
   * Returns respt. {@link Definition} object for a given WSDL {@link IFile}
   *
   * @param file
   * @return
   */
  public static final Definition resolveWSDL(final java.net.URI uri) {
    final URI emfUri = URI.createURI(uri.toString());
    final ResourceSet rs = new ResourceSetImpl();
    final WSDLResourceImpl wsdlr = (WSDLResourceImpl) rs.getResource(emfUri, true);

    return wsdlr.getDefinition();
  }
  /*
   * Writes the wsdl definition to the file at the given path, relative to the target folder.
   */
  private String writeXMLObj(IPath path, Definition definition, IProgressMonitor monitor)
      throws WSDLException, URIException, IOException, CoreException {

    String[] targetURI = appendPathToURI(targetFolderURI, path);

    OutputStream os = uriFactory.newURI(targetURI[0]).getOutputStream();

    DefinitionImpl definitionImpl = (DefinitionImpl) definition;
    WSDLResourceImpl resource = (WSDLResourceImpl) definitionImpl.eResource();
    Document document = definitionImpl.getDocument();
    resource.serialize(os, document, document.getXmlEncoding());

    os.close();

    return targetURI[1];
  }