Package org.apache.woden

Examples of org.apache.woden.WSDLException


        URL url = new URL(urlStrings[i]);
        urls.add(url);
      } catch (MalformedURLException e) {
        // Bad URLs are discarded noisily
        // TODO should log a woden warning, ignore entry, and continue thru list instead of following?
        throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
            "Invalid URL '" + urlStrings[i] + "' in base URL list '" + rootURLs + "'",
                      e);
        // TODO or logging like :
        //logger.error("Invalid URL "+urlStrings[i]+": "+e.getMessage());
      }
View Full Code Here


  public static void throwWSDLException(Element location) throws WSDLException
  {
    String elName = DOMQNameUtils.newQName(location).toString();

    WSDLException wsdlExc = new WSDLException(WSDLException.INVALID_WSDL,
                                              "Encountered unexpected element '" +
                                              elName + "'.");

    wsdlExc.setLocation(XPathUtils.getXPathExprFromNode(location));

    throw wsdlExc;
  }
View Full Code Here

      String attrName = DOMQNameUtils.newQName((Attr)i.next()).toString();
      sb.append(attrName);
      sb.append( i.hasNext() ? " " : "");
    }

    WSDLException wsdlExc = new WSDLException(WSDLException.INVALID_WSDL,
                                              "Element '" +
                                              elName +
                                              "' contained unexpected attributes: '" +
                                              sb.toString() +
                                              "'");

    wsdlExc.setLocation(XPathUtils.getXPathExprFromNode(location));

    throw wsdlExc;
  }
View Full Code Here

           
        } catch (MalformedURLException e) {
           
            String msg = getErrorReporter().getFormattedMessage(
                            "WSDL516", new Object[] {wsdlURI});
            throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
        }
        String wsdlURL = url.toString();
          
        // ensure InputSource runs thru the URI Resolver
        InputSource inputSource = new InputSource(resolveURI(wsdlURL));
View Full Code Here

               
            } catch (MalformedURLException e) {
               
                String msg = getErrorReporter().getFormattedMessage(
                        "WSDL516", new Object[] {baseURI.toString()});
                throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
            }
            wsdlURL = url.toString();
        }
       
        if(source instanceof Element) {
            return readWSDL(wsdlURL, (Element)source);
        }
        else if(source instanceof Document) {
            return readWSDL(wsdlURL, (Document)source);
        }
        else if(source instanceof InputSource) {
            return readWSDL(wsdlURL, (InputSource)source);
        }
        else {
            //This exception is checked in WSDLSource.setSource but we check
            //again here in case the wrong type of WSDLSource has been used
            //with this type of WSDLReader.
            String sourceClass = source.getClass().getName();
            String readerClass = this.getClass().getName();
            String msg = getErrorReporter().getFormattedMessage(
                    "WSDL017", new Object[] {sourceClass, readerClass});
            throw new WSDLException(WSDLException.PARSER_ERROR, msg);
        }
    }
View Full Code Here

        try {
            uri = new URI(wsdlURI);
        } catch (URISyntaxException e) {
            String msg = getErrorReporter().getFormattedMessage(
                    "WSDL506", new Object[] {null, wsdlURI});
            throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
        }
       
        String fragment = uri.getFragment();
       
       
        if (fragment == null) { //No fragment identifier so just use the root element.
            return readWSDL(wsdlURI, domDoc.getDocumentElement());//Use document root if no WSDL20 root found.
        } else {
            XPointer xpointer;
            try {
                xpointer = new XPointer(fragment);
            } catch(InvalidXPointerException e) {
                String msg = getErrorReporter().getFormattedMessage(
                        "WSDL530", new Object[] {fragment, wsdlURI});
                throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
            }
            Element root = domDoc.getDocumentElement();
           
            DOMXMLElementEvaluator evaluator = new DOMXMLElementEvaluator(xpointer, root, getErrorReporter());
            Element result = evaluator.evaluateElement();
           
            if (result != null) { //Element from XPointer evaluation.
                return readWSDL(wsdlURI, result);
            } else {
                String msg = getErrorReporter().getFormattedMessage(
                        "WSDL531", new Object[] {fragment, wsdlURI});
                throw new WSDLException(WSDLException.PARSER_ERROR, msg);
            }
        }
    }
View Full Code Here

            return readWSDL(wsdlURI, wsdlDocument);
           
        } catch (IOException e) {
            String msg = getErrorReporter().getFormattedMessage(
                    "WSDL503", new Object[] {wsdlURI});
            throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
        }
    }
View Full Code Here

            DocumentBuilder builder = createDocumentBuilder(factory, entityResolver, errorHandler);
            doc = builder.parse(inputSource);

        } catch (ParserConfigurationException e) {
            String msg = getErrorReporter().getFormattedMessage("WSDL002", new Object[] { "XML" });
            throw new WSDLException(WSDLException.CONFIGURATION_ERROR, msg, e);
        } catch (SAXException e) {
            getErrorReporter().reportError(new ErrorLocatorImpl(), //TODO line&col nos.
                    "WSDL500", new Object[] { "SAX", desc }, ErrorReporter.SEVERITY_FATAL_ERROR, e);
        }
View Full Code Here

                ClassNotFoundException
                InstantiationException
                IllegalAccessException
                */
              
               throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                       "Problem instantiating a URIResolver implementation " +
                       "using classname '" + defaultURIResolver + "' ",
                       e);
           }
        }
View Full Code Here

                              ? ((OutputStreamWriter)sink).getEncoding()
                              : null;
        String xmlEncoding = DOM2Writer.java2XMLEncoding(javaEncoding);
        if (xmlEncoding == null)
       {
           throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                   "Unsupported Java encoding for writing " +
                   "wsdl file: '" + javaEncoding + "'.");
       }
        pw.println(Constants.XML_DECL_START +
               xmlEncoding +
View Full Code Here

TOP

Related Classes of org.apache.woden.WSDLException

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.