Package org.apache.woden

Examples of org.apache.woden.WSDLException


            for(int ind=0;ind<extensibilityElements.length;ind++){
                ExtensionElement ext =extensibilityElements[ind];
                QName elementType = ext.getExtensionType();
                ExtensionRegistry extReg = fWsdlContext.extensionRegistry;
                if (extReg == null){
                    throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                            "No ExtensionRegistry set for this " +
                            "Description, so unable to serialize a '" +
                            elementType +
                            "' element in the context of a '" +
                            parentType.getName() + "'.");
View Full Code Here


      es = defaultSer;
    }

    if (es == null)
    {
      throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                              "No ExtensionSerializer found " +
                              "to serialize a '" + elementType +
                              "' element in the context of a '" +
                              parentType.getName() + "'.");
    }
View Full Code Here

      ed = defaultDeser;
    }

    if (ed == null)
    {
      throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                              "No ExtensionDeserializer found " +
                              "to deserialize a '" + elementType +
                              "' element in the context of a '" +
                              parentType.getName() + "'.");
    }
View Full Code Here

    }

    if (extensionType == null)
    {
      //TODO use ErrorReporter to get formatted error msg WSDL012
      throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                              "No Java extensionType found " +
                              "to represent a '" + elementType +
                              "' element in the context of a '" +
                              parentType.getName() + "'.");
    }
    else if (!(ExtensionElement.class.isAssignableFrom(extensionType)))
    {
      //TODO use ErrorReporter to get formatted error msg WSDL013
      throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                              "The Java extensionType '" +
                              extensionType.getName() + "' does " +
                              "not implement the ExtensibilityElement " +
                              "interface.");
    }

    try
    {
        ExtensionElement ee = (ExtensionElement)extensionType.newInstance();
      /*
      if (ee.getElementType() == null)
      {
        ee.setElementType(elementQN);
      }
      */
     
      return ee;
    }
    catch (Exception e)
    {
      /*
        Catches:
                 InstantiationException
                 IllegalAccessException
      */
      throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                              "Problem instantiating Java " +
                              "extensionType '" + extensionType.getName() +
                              "'.",
                              e);
    }
View Full Code Here

      }
      else if (!(XMLAttr.class.isAssignableFrom(implClass)))
      {
          String msg = getErrorReporter().getFormattedMessage("WSDL011",
                           new Object[] {attrQName.toString()});   
          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL011: " + msg);
      }
     
      try {
          Class[] ctorParms = new Class[] {XMLElement.class, QName.class, String.class, ErrorReporter.class};
          Constructor ctor = implClass.getConstructor(ctorParms);
          Object[] ctorParmValues = new Object[] {ownerElement, attrQName, attrValue, getErrorReporter()};
          attr = (XMLAttr)ctor.newInstance(ctorParmValues);
      }
      catch (Exception e) {
          //SecurityException
          //NoSuchMethodException
          //InvocationTargetException
          //InstantiationException
          //IllegalAccessException
          String msg = getErrorReporter().getFormattedMessage("WSDL009",
                           new Object[] {implClass.getName()});
          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL009: " + msg, e);
      }
     
      return attr;
  }
View Full Code Here

     
      if(compExtCtxClass == null)
      {
          String msg = getErrorReporter().getFormattedMessage("WSDL015",
                  new Object[] {extNamespace.toString(), parentClass.getName()});
          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL015: " + msg);
      }
         
      ComponentExtensionContext compExtCtx = null;
     
      /* TODO remove with woden-47
      try {
          compExtCtx = (ComponentExtensionContext)compExtCtxClass.newInstance();
      }
      catch (InstantiationException e)
      {
          String msg = getErrorReporter().getFormattedMessage("WSDL009",
                  new Object[] {compExtCtxClass.getName()});
          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL009: " + msg, e);
      }
      catch (IllegalAccessException e) {
          String msg = getErrorReporter().getFormattedMessage("WSDL009",
                  new Object[] {compExtCtxClass.getName()});
          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL009: " + msg, e);
      }
      */
     
     
      try {
          Class[] ctorParms = new Class[] {WSDLComponent.class, URI.class, ErrorReporter.class};
          Constructor ctor = compExtCtxClass.getConstructor(ctorParms);
          Object[] ctorParmValues = new Object[] {parentComp, extNamespace, getErrorReporter()};
          compExtCtx = (ComponentExtensionContext)ctor.newInstance(ctorParmValues);
      }
      catch (Exception e) {
          //SecurityException
          //NoSuchMethodException
          //InvocationTargetException
          //InstantiationException
          //IllegalAccessException
          String msg = getErrorReporter().getFormattedMessage("WSDL009",
                           new Object[] {compExtCtxClass.getName()});
          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL009: " + msg, e);
      }
     
     
      return compExtCtx;
  }
View Full Code Here

        try {
            url = StringUtils.getURL(null, wsdlURI);
        } catch (MalformedURLException e) {
            String msg = getErrorReporter().getFormattedMessage(
                            "WSDL516", new Object[] {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

               
            } 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 OMElement) {
            return readWSDL(wsdlURL, (OMElement)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 {
                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

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.