Examples of BindingFaultElement


Examples of org.apache.woden.wsdl20.xml.BindingFaultElement

    private BindingFaultElement parseBindingFault(XMLElement bindFaultEl,
            DescriptionElement desc,
            BindingElement parent)
            throws WSDLException {

        BindingFaultElement fault = parent.addBindingFaultElement();

        QName intFltQN = null;
        String ref = bindFaultEl.getAttributeValue(Constants.ATTR_REF);
        if(ref != null)
        {
            try {
                intFltQN = bindFaultEl.getQName(ref);
                fault.setRef(intFltQN);
            } catch (WSDLException e) {
                getErrorReporter().reportError(
                        new ErrorLocatorImpl()//TODO line&col nos.
                        "WSDL505",
                        new Object[] {ref, bindFaultEl.getQName()},
                        ErrorReporter.SEVERITY_ERROR);
            }
        }

        parseExtensionAttributes(bindFaultEl, BindingFaultElement.class, fault, desc);

        /* Parse the child elements of binding <fault>.
         * As per WSDL 2.0 spec, they must be in the following order if present:
         * <documentation>
         * extension elements in any order
         * TODO validate that the elements are in correct order
         */

        XMLElement[] children = bindFaultEl.getChildElements();
        XMLElement tempEl = null;
        QName tempElQN = null;

        for(int i=0; i<children.length; i++)
        {
            tempEl = children[i];
            tempElQN = tempEl.getQName();

            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
            {
                parseDocumentation(tempEl, desc, fault);
            }
            else
            {
                fault.addExtensionElement(
                        parseExtensionElement(BindingFaultElement.class, fault, tempEl, desc) );
            }
        }

        return fault;
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingFaultElement

     * TODO decide if this type of qname-based accessor is needed, either internally or on API.
     * TODO also consider if getBindingFaultWithRef is needed (i.e. component model)
     */
    public BindingFaultElement getBindingFaultElementWithRef(QName qname)
    {
        BindingFaultElement fault = null;
        if(qname != null)
        {
            BindingFaultElement bindFault = null;
            Iterator i = fFaults.iterator();
            while(i.hasNext())
            {
                bindFault = (BindingFaultElement)i.next();
                if(qname.equals(bindFault.getRef()))
                {
                    fault = bindFault;
                    break;
                }
            }
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingFaultElement

      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
    if(!val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
    {
      fail("The testAssertionBinding1044 method returned false for a binding with an interface and a fault specified.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true when an operation and a fault are specified
  // and an interface is specified.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
    if(!val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
    {
      fail("The testAssertionBinding1044 method returned false for a binding with an interface and an operation and a fault specified.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false when an operation is specified
  // and no interface is specified.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name1);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
    if(val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
    {
      fail("The testAssertionBinding1044 method returned true for a binding with an operation and no interface.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false when a fault is specified
  // and no interface is specified.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name1);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
    if(val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
    {
      fail("The testAssertionBinding1044 method returned true for a binding with a fault and no interface.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false when an operation and a fault are specified
  // and no interface is specified.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name1);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
    if(val.testAssertionBinding1044(descEl.toComponent().getBindings()[0], reporter))
    {
      fail("The testAssertionBinding1044 method returned true for a binding with an operation and a fault and no interface.");
    }
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingFaultElement

      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name2);
     
      BindingElement binding = descEl.addBindingElement();
      binding.setInterfaceName(name1QN);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
    bindingFault.setRef(name2QN);
     
      descEl.toComponent().getBindings(); //init Binding's ref to its Description
     
      if(!val.testAssertionBindingFault1050(new BindingFault[]{(BindingFaultImpl)bindingFault}, reporter))
    {
      fail("The testAssertionBindingFault1050 method returned false for an list of binding faults that contains only one binding.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true for a list of binding faults that contains no duplicate interface fault references.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name1);
      InterfaceFaultElement interfaceFault2 = interfac.addInterfaceFaultElement();
      interfaceFault2.setName(name2);
      InterfaceFaultElement interfaceFault3 = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name3);
     
      BindingElement binding = descEl.addBindingElement();
      binding.setInterfaceName(name1QN);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
    bindingFault.setRef(name1QN);
      BindingFaultElement bindingFault2 = binding.addBindingFaultElement();
    bindingFault2.setRef(name2QN);
      BindingFaultElement bindingFault3 = binding.addBindingFaultElement();
    bindingFault3.setRef(name3QN);
   
      descEl.toComponent().getBindings(); //init Binding's ref to its Description
     
    BindingFault[] bindingFaults = new BindingFault[]{(BindingFaultImpl)bindingFault, (BindingFaultImpl)bindingFault2, (BindingFaultImpl)bindingFault3};
   
    if(!val.testAssertionBindingFault1050(bindingFaults, reporter))
    {
      fail("The testAssertionBindingFault1050 method returned false for a list of binding faults that contains no duplicate interface fault references.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false for two binding faults that are defined with the same interface fault reference.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceFaultElement interfaceFault = interfac.addInterfaceFaultElement();
      interfaceFault.setName(name1);
      InterfaceFaultElement interfaceFault2 = interfac.addInterfaceFaultElement();
      interfaceFault2.setName(name2);
     
      BindingElement binding = descEl.addBindingElement();
      binding.setInterfaceName(name1QN);
      BindingFaultElement bindingFault = binding.addBindingFaultElement();
      bindingFault.setRef(name1QN);
      BindingFaultElement bindingFault2 = binding.addBindingFaultElement();
      bindingFault2.setRef(name2QN);
      BindingFaultElement bindingFault3 = binding.addBindingFaultElement();
      bindingFault3.setRef(name1QN);
     
      descEl.toComponent().getBindings(); //init Binding's ref to its Description
     
    BindingFault[] bindingFaults = new BindingFault[]{(BindingFaultImpl)bindingFault, (BindingFaultImpl)bindingFault2, (BindingFaultImpl)bindingFault3};
   
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingFaultElement

    BindingFault[] bfArray = fBinding.getBindingFaults();
    assertNotNull("Expected an array of BindingFaults -", bfArray);
    assertEquals("Retrieved BindingFaultElement group should be empty if none set -", 0, bfArray.length);

    // addBindingFaultElement()
    BindingFaultElement bfe1 = fBindingElement.addBindingFaultElement();
    BindingFaultElement bfe2 = fBindingElement.addBindingFaultElement();

    // getBindingFaultElements()
    bfArray = fBinding.getBindingFaults();
    assertNotNull("Expected an array of BindingFaults -", bfArray);
    assertEquals("Incorrect number of retrieved BindingFaults -", 2, bfArray.length);
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingFaultElement

    private BindingFaultElement parseBindingFault(XMLElement bindFaultEl,
            DescriptionElement desc,
            BindingElement parent)
            throws WSDLException {

        BindingFaultElement fault = parent.addBindingFaultElement();

        QName intFltQN = null;
        String ref = bindFaultEl.getAttributeValue(Constants.ATTR_REF);
        if(ref != null)
        {
            try {
                intFltQN = bindFaultEl.getQName(ref);
                fault.setRef(intFltQN);
            } catch (WSDLException e) {
                getErrorReporter().reportError(
                        new ErrorLocatorImpl()//TODO line&col nos.
                        "WSDL505",
                        new Object[] {ref, bindFaultEl.getQName()},
                        ErrorReporter.SEVERITY_ERROR);
            }
        }

        parseExtensionAttributes(bindFaultEl, BindingFaultElement.class, fault, desc);

        /* Parse the child elements of binding <fault>.
         * As per WSDL 2.0 spec, they must be in the following order if present:
         * <documentation>
         * extension elements in any order
         * TODO validate that the elements are in correct order
         */

        XMLElement[] children = bindFaultEl.getChildElements();
        XMLElement tempEl = null;
        QName tempElQN = null;

        for(int i=0; i<children.length; i++)
        {
            tempEl = children[i];
            tempElQN = tempEl.getQName();

            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
            {
                parseDocumentation(tempEl, desc, fault);
            }
            else
            {
                fault.addExtensionElement(
                        parseExtensionElement(BindingFaultElement.class, fault, tempEl, desc) );
            }
        }

        return fault;
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingFaultElement

                DOMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                          Constants.ELEM_FAULT,
                          des);
            for(int ind=0;ind<faults.length;ind++){

                BindingFaultElement fault =faults[ind] ;
                if (fault!=null){

                    pw.print("    <" + tagName);
                    DOMUtils.printQualifiedAttribute(Constants.ATTR_REF,
                            fault.getRef(),
                             des,
                             pw);

                    printExtensibilityAttributes(fault.getExtensionAttributes(), fault, pw);
                    pw.println("/>");

                }
            }
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingFaultElement

                 OMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                           Constants.ELEM_FAULT,
                           des);
             for(int ind=0;ind<faults.length;ind++){

                 BindingFaultElement fault =faults[ind] ;
                 if (fault!=null){

                     pw.print("    <" + tagName);
                     OMUtils.printQualifiedAttribute(Constants.ATTR_REF,
                             fault.getRef(),
                              des,
                              pw);

                     printExtensibilityAttributes(fault.getExtensionAttributes(), fault, pw);
                     pw.println("/>");

                 }
             }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.