Package org.xml.sax

Examples of org.xml.sax.InputSource


        Document doc = null;
        try {
            setExternalSchemaLocations(schemas);
            // StackTraceErrorHandler handler = setErrorHandler();
            setErrorHandler();
            doc = doValidation(new InputSource(getWsdlUrl(wsdlsource)), false);
            /*
             * if (!handler.isValid()) { ToolException ex = new
             * ToolException(handler.getErrorMessages()); throw ex; }
             */
        } catch (Exception e) {
View Full Code Here


                        String msg = "Can't resolve entity from publicID=" + publicID + ", systemID="
                                     + systemID;

                        throw new IOException(msg);
                    }
                    return new InputSource(url);
                }
            };

            parser.setEntityResolver(eresolver);
View Full Code Here

                if (!"".equals(ns) && !"".equals(loc)) {

                    SchemaWSDLValidator validator = new SchemaWSDLValidator(schemaLocation);
                    validator.setErrorHandler(getErrorHandler());

                    validator.validate(new InputSource(getWsdlUrl(base, loc)), null, true);

                    if (!getErrorHandler().isValid()) {
                        throw new SAXException(getErrorHandler().getErrorMessages());
                    }
                    return doc;
View Full Code Here

        }
        return result;
    }

    private InputSource copyInputSource(InputSource source, byte[] stream) {
        InputSource is = new InputSource(source.getSystemId());

        is.setPublicId(source.getPublicId());
        is.setEncoding(source.getEncoding());
        if (stream != null) {
            is.setByteStream(new ByteArrayInputStream(stream));
        }

        return is;
    }
View Full Code Here

        SOAPService service = new SOAPService(wsdl, serviceName);
        assertNotNull(service);

        InputStream is =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
        InputSource inputSource =  new InputSource(is);
        SAXSource saxSourceReq = new SAXSource(inputSource);
        assertNotNull(saxSourceReq);
       
        InputStream is1 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
        InputSource inputSource1 =  new InputSource(is1);
        SAXSource saxSourceReq1 = new SAXSource(inputSource1);
        assertNotNull(saxSourceReq1);
       
        InputStream is2 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
        InputSource inputSource2 =  new InputSource(is2);
        SAXSource saxSourceReq2 = new SAXSource(inputSource2);
        assertNotNull(saxSourceReq2);
       
        InputStream is3 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
        InputSource inputSource3 =  new InputSource(is3);
        SAXSource saxSourceReq3 = new SAXSource(inputSource3);
        assertNotNull(saxSourceReq3);

        Dispatch<SAXSource> disp = service.createDispatch(portName,
                                                            SAXSource.class, Service.Mode.MESSAGE);
View Full Code Here

        SOAPService service = new SOAPService(wsdl, serviceName);
        assertNotNull(service);

        InputStream is =  getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq.xml");
        InputSource inputSource =  new InputSource(is);
        SAXSource saxSourceReq = new SAXSource(inputSource);
        assertNotNull(saxSourceReq);
       
        InputStream is1 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq1.xml");
        InputSource inputSource1 =  new InputSource(is1);
        SAXSource saxSourceReq1 = new SAXSource(inputSource1);
        assertNotNull(saxSourceReq1);
       
        InputStream is2 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq2.xml");
        InputSource inputSource2 =  new InputSource(is2);
        SAXSource saxSourceReq2 = new SAXSource(inputSource2);
        assertNotNull(saxSourceReq2);
       
        InputStream is3 =  getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq3.xml");
        InputSource inputSource3 =  new InputSource(is3);
        SAXSource saxSourceReq3 = new SAXSource(inputSource3);
        assertNotNull(saxSourceReq3);

        Dispatch<SAXSource> disp = service.createDispatch(portName,
                                                            SAXSource.class, Service.Mode.PAYLOAD);
View Full Code Here

    }
  
   
    private void checkSAXSource(String expected, SAXSource source) {
       
        InputSource inputSource =  source.getInputSource();
        InputStream is = inputSource.getByteStream();
       
        int i = 0;
        StringBuilder sb = new StringBuilder();
        try {
            while (i != -1) {
View Full Code Here

            log.warning("Can't XSL transform " + this.xslTransformerName + ": " + ex.toString());
            throw new Exception("Can't XSL transform " + this.xslTransformerName + ": " + ex.toString());
         }
      }
     
      InputSource inputSource = null;
      if (useReaderCharset)
         inputSource = new InputSource(new InputStreamReader(is));
      else
         inputSource = new InputSource(is);
      if (encoding != null)
         inputSource.setEncoding(encoding); // this only has an effect if the input source contains an InputStream an not
                                   // a character stream (Reader)
      try {
         this.updateRecord = new SqlInfo(this.info);
         init(inputSource);      // use SAX parser to parse it (is slow)
         return this.updateRecord;
View Full Code Here

            } else if (SAXSource.class.isAssignableFrom(callback.getSupportedFormats()[0])) {
               
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                src.writeTo(baos);
                ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
                InputSource inputSource = new InputSource(bais);
                obj = new SAXSource(inputSource);
               
            } else if (StreamSource.class.isAssignableFrom(callback.getSupportedFormats()[0])) {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                src.writeTo(baos);
View Full Code Here

          oReader = new FileReader(oXMLFile);
          if (DebugFile.trace) DebugFile.writeln("DOMParserWrapper.parse([InputSource])");
        } else {
          oReader = new InputStreamReader(new FileInputStream(oXMLFile), sEncoding);
        }
        oDocument = oParserWrapper.parse(new InputSource(oReader));
        oReader.close();
      }
      else {
        if (DebugFile.trace) DebugFile.writeln("DOMParserWrapper.parse(" + sURI + ")");
        oDocument = oParserWrapper.parse(sURI);
View Full Code Here

TOP

Related Classes of org.xml.sax.InputSource

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.