Package org.apache.woden

Examples of org.apache.woden.WSDLException


  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

            return fTypesElement;
        } else {
            String msg = fWsdlContext.errorReporter.getFormattedMessage(
                    "WSDL523",
                    null);
            throw new WSDLException(WSDLException.OTHER_ERROR, msg);
        }
    }
View Full Code Here

        try {
            url = StringUtils.getURL(null, wsdlURI);
        } catch (MalformedURLException e) {
            String msg = getErrorReporter().getFormattedMessage(
                            "WSDL502", new Object[] {null, wsdlURI});
            throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
        }
        String wsdlURL = url.toString();

        OMElement root = null;

        // perform URI Resolution here
        try {
            root = OMUtils.getElement(resolveURI(wsdlURL));
        } catch (IOException e){
            String msg = getErrorReporter().getFormattedMessage(
                    "WSDL503", new Object[] {wsdlURI});
            throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
        } catch (URISyntaxException e){
            String msg = getErrorReporter().getFormattedMessage(
                    "WSDL502", new Object[] {null, wsdlURI});
            throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
        } catch (XMLStreamException e){
            String msg = getErrorReporter().getFormattedMessage(
                    "WSDL500", new Object[] {"XML", wsdlURI});
            throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
        }
        //Try to find an element the XPointer points to if a Fragment Identifier exists.
        URI uri = null;
        try {
            uri = new URI(wsdlURI);
        } catch (URISyntaxException e) {
            String msg = getErrorReporter().getFormattedMessage(
                    "WSDL506", new Object[] {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.
            XMLElement descEl = createXMLElement(root);
            DescriptionElement descElem = parseDescription(url.toString(), descEl, null);
            return descElem.toComponent();
        } 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);
            }
           
            OMXMLElementEvaluator evaluator = new OMXMLElementEvaluator(xpointer, root, getErrorReporter());
            OMElement result = evaluator.evaluateElement();
           
            if (result != null) { //Element from XPointer evaluation.
                XMLElement descEl = createXMLElement(result);
                DescriptionElement descElem = parseDescription(url.toString(), descEl, null);
                return descElem.toComponent();
            } else {
                String msg = getErrorReporter().getFormattedMessage(
                        "WSDL531", new Object[] {fragment, wsdlURI});
                throw new WSDLException(WSDLException.PARSER_ERROR, msg);
            }
        }
    }
View Full Code Here

            try {
                importedSchemaDoc = OMUtils.getElement(schemaURL);
            } catch (URISyntaxException e){
                String msg = getErrorReporter().getFormattedMessage(
                        "WSDL502", new Object[] {null, schemaURL});
                throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
            } catch (XMLStreamException e){
                String msg = getErrorReporter().getFormattedMessage(
                        "WSDL500", new Object[] {"XML", schemaURL});
                throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
            } catch (IOException e4) {
               
                //schema retrieval failed (e.g. 'not found')
                getErrorReporter().reportError(
                        new ErrorLocatorImpl()//TODO line&col nos.
View Full Code Here

            try {
                docEl = OMUtils.getElement(locationStr);
            } catch (URISyntaxException e){
                String msg = getErrorReporter().getFormattedMessage(
                        "WSDL502", new Object[] {null, locationStr});
                throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
            } catch (XMLStreamException e){
                String msg = getErrorReporter().getFormattedMessage(
                        "WSDL500", new Object[] {"XML", locationStr});
                throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
            } catch (IOException e) {
                // document retrieval failed (e.g. 'not found')
                getErrorReporter().reportError(
                        new ErrorLocatorImpl()// TODO line&col nos.
                        "WSDL503",
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

        if (nsStr != null) {
            try {
                uri = new URI(nsStr);
            } catch (URISyntaxException e) {
                String msg = fErrorReporter.getFormattedMessage("WSDL506", new Object[] { nsStr });
                throw new WSDLException(WSDLException.INVALID_WSDL, msg, e);
            }
        }
        return uri;
    }
View Full Code Here

        if(prefix != null && namespaceURI == null) {
            String faultCode = WSDLException.UNBOUND_PREFIX;
            String msg = fErrorReporter.getFormattedMessage(
                    "WSDL513",
                    new Object[] {prefixedValue, elem.getQName()});
            WSDLException wsdlExc = new WSDLException(
                    faultCode,
                    msg);
            //TODO wsdlExc.setLocation(XPathUtils.getXPathExprFromNode(el));
            throw wsdlExc;
        }
View Full Code Here

           
        } catch (MalformedURLException e) {
           
            String msg = getErrorReporter().getFormattedMessage(
                            "WSDL502", new Object[] {null, 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

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.