Package org.eclipse.wst.wsi.internal.core

Examples of org.eclipse.wst.wsi.internal.core.WSIException


      Definition definition = null;
      if ((definition =
        validator.analyzerContext.getCandidateInfo().getDefinition(types))
        == null)
      {
        throw new WSIException("Could not find types definition in any WSDL document.");
      }

      Iterator it = exts.iterator();
      while (it.hasNext())
      {
View Full Code Here


        this.wsdlDocument = new WSDLDocument(wsdlURI);
    }

    catch (WSDLException we)
    {
      throw new WSIException(we.getMessage(), we);
    }

  }
View Full Code Here

      this.profileAssertions = WSITestToolsProperties.getProfileAssertions(
                getAnalyzerConfig().getTestAssertionsDocumentLocation());

      if (this.profileAssertions == null)
      {
        throw new WSIException(messageList.getMessage("config20",
              "The WS-I Test Assertion Document (TAD)document was either not found or could not be processed."))
     

      // Create report from document factory
      report = documentFactory.newReport();
      report.setLocation(getAnalyzerConfig().getReportLocation());

      // Create report context
      ReportContext reportContext =
        new ReportContext(
          WSIConstants.DEFAULT_REPORT_TITLE,
          profileAssertions,
          this);
      report.setReportContext(reportContext);

      // Create report writer
      reportWriter = documentFactory.newReportWriter();
      // I18N: 2003.02.26 modified by K.Nakagome@BeaconIT
      //reportWriter.setWriter(new FileWriter(analyzerConfig.getReportLocation()));
      reportWriter.setWriter(getAnalyzerConfig().getReportLocation());

      // Create reporter
      this.reporter = new DefaultReporter(report, reportWriter);

      // fetch WSDL if not set in constructor
      // First, attempt to get the WSDL URI from a UDDI tModel
      if ((wsdlDocument == null) && (getAnalyzerConfig().isUDDIReferenceSet()))
              wsdlDocument = getWsdlFromUddi();

      /* Next, try to use the WSDL settings from the config file.  If we can't
       * fetch that WSDL, and the config file is set up to test a WSDL, then the
       * validator fails here. */
      if ((wsdlDocument == null) && (getAnalyzerConfig().isWSDLReferenceSet()))
      {
          wsdlDocument = new WSDLDocument(getAnalyzerConfig().
                  getWSDLLocation());

          if (wsdlDocument == null)
              throw new WSIException(messageList.getMessage("config05",
                      "WSDL document was either not found or could not be " +
                      "processed."));
      }
     
      /*
       * Only validate messages against a wsdl document if the wsdl document
       * does not contain soap 1.2 bindings.
       */
    if (WSDLUtils.isSOAP12WSDL(wsdlDocument) && getAnalyzerConfig().getLogLocation() != null)
      getAnalyzerConfig().setWSDLReference(null);
    else
      analyzerContext.setWsdlDocument(wsdlDocument)

      // Start writing report
      this.reporter.startReport();

      // Walk through the artifact elements from the TAD, validating each one
      profileAssertions.getArtifactList().keySet().iterator();
      for (Iterator i = profileAssertions.getArtifactList().keySet().iterator();
              i.hasNext(); ) {
          String artifactType = (String) i.next();
          // Set current artifact
          reportArtifact = setCurrentArtifact(ArtifactType.getArtifactType(
                  artifactType));
          validate(reportArtifact, factory.getValidatorForArtifact(
                  artifactType));
          this.reporter.endCurrentArtifact();
      }

      // Finish the conformance report
      reporter.finishReport();
    }
    catch (Exception e)
    {
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);

      String message =
        messageList.getMessage(
          "error03",
          "The conformance validation process failed.");

      // Finish report
      if (reporter != null)
      {
        pw.println(message);
        pw.println(
          messageList.getMessage("exception01", "Exception: ")
            + e.getClass().getName());
        e.printStackTrace(pw);
        reporter.finishReportWithError(sw.toString());
      }

      if (e instanceof WSIException)
        throw (WSIException) e;
      else
        throw new WSIException(message, e);
    }
    finally
    {
      if (reportWriter != null)
      {
View Full Code Here

        debug("processMessage", "Processing chunked data...");

        // Get the location of the first CFLF
        if ((index = readMsg.indexOf(CRLF + CRLF)) == -1)
        {
          throw new WSIException("Could not locate end of HTTP header.");
        }

        // Include the CRLF+CRLF in the index
        index += 4;
View Full Code Here

      // Should not have complete POST header without content length
      if (httpHeader.startsWith("POST"))
      {
        if (httpHeader.endsWith(CRLF + CRLF))
        {
          throw new WSIException("Could not locate content-length in HTTP POST header.");
        }

        messageComplete = false;
      }
View Full Code Here

      }

      catch (Exception e)
      {
        // Throw WSIException
        throw new WSIException("Could not get tModel details.", e);
      }
    }

    else
    {
View Full Code Here

        fnfe);
    }

    catch (Exception e)
    {
      throw new WSIException(
        getMessage("config03", monitorConfigURI, "Could not read file:"),
        e);
    }

    return readMonitorConfig(fileReader);
View Full Code Here

    String intValue = null;

    // Get value as a string
    if ((intValue = XMLUtils.getText(element)) == null)
    {
      throw new WSIException(
        getMessage(
          "config04",
          element.getLocalName() + "Element must contain an integer value:"));
    }
View Full Code Here

      assertionResultType = NOT_INFO;
    }

    else
    {
      throw new WSIException(
        "An invalid assertion result type was specified: " + resultType + ".");
    }

    return assertionResultType;
  }
View Full Code Here

    monitorConfig.parseArgs(args);

    String logLocation = monitorConfig.getLogLocation();
    if (logLocation.indexOf(WSIConstants.PATH_SEPARATOR) > -1)
    {
      throw new WSIException(
        messageList.getMessage(
          "config11",
          monitorConfig.getLogLocation(),
          "The log file location value cannot contain the pass separator character:"));
    }

    File file = null;
    try
    {
      // Get file object for log file
      file = new File(monitorConfig.getLogLocation());
    }

    catch (Exception e)
    {
      throw new WSIException(
        messageList.getMessage("config07", "Could not get log file location."),
        e);
    }

    // If replace flag is false and file exists, then throw exception
    if (file.exists() && !monitorConfig.getReplaceLog())
    {
      throw new IllegalArgumentException(
        messageList.getMessage(
          "config08",
          monitorConfig.getLogLocation(),
          "Log file already exists:"));
    }

    try
    {
      // Create output file
      log = documentFactory.newLog();

      // Set style sheet string
      log.setStyleSheetString(
        monitorConfig.getAddStyleSheet().getStyleSheetString());

      // Get log writer
      logWriter = documentFactory.newLogWriter();
      logWriter.setWriter(monitorConfig.getLogLocation());

      // Write start of log file
      logWriter.write(new StringReader(log.getStartXMLString("")));

      // Write monitor tool information
      logWriter.write(new StringReader(toXMLString("")));

      // Create log entry queue
      messageEntryQueue = new MessageEntryQueue(this, log, logWriter);
    }

    catch (Exception e)
    {
      throw new WSIException(
        messageList.getMessage(
          "error03",
          "Could not create log or log writer."),
        e);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsi.internal.core.WSIException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.