Package org.apache.woden.wsdl20

Examples of org.apache.woden.wsdl20.InterfaceFaultReference


    public void testGetSoapModules_infault()
    {
        BindingFaultReference bindFaultRef = fBindOper.getBindingFaultReferences()[0];
        assertNotNull("The BindingOperation does not contain a BindingFaultReference.", bindFaultRef);

        InterfaceFaultReference intFaultRef = bindFaultRef.getInterfaceFaultReference();
        Direction direction = intFaultRef.getDirection();
        assertTrue("The BindingFaultReference does not represent an <infault> element.", Direction.IN.equals(direction));

        SOAPBindingFaultReferenceExtensions soapBindFaultRefExts =
            (SOAPBindingFaultReferenceExtensions) bindFaultRef.getComponentExtensionContext(SOAPConstants.NS_URI_SOAP);
        SOAPModule[] actual = soapBindFaultRefExts.getSoapModules();
View Full Code Here


    public void testGetSoapModules_outfault()
    {
        BindingFaultReference bindFaultRef = fBindOper.getBindingFaultReferences()[1];
        assertNotNull("The BindingOperation does not contain a second BindingFaultReference.", bindFaultRef);

        InterfaceFaultReference intFaultRef = bindFaultRef.getInterfaceFaultReference();
        Direction direction = intFaultRef.getDirection();
        assertTrue("The BindingFaultReference does not represent an <outfault> element.", Direction.OUT.equals(direction));

        SOAPBindingFaultReferenceExtensions soapBindFaultRefExts =
            (SOAPBindingFaultReferenceExtensions) bindFaultRef.getComponentExtensionContext(SOAPConstants.NS_URI_SOAP);
        SOAPModule[] actual = soapBindFaultRefExts.getSoapModules();
View Full Code Here

     * where the message label property IS NOT present in the binding fault reference.
     *
     */
    public InterfaceFaultReference getInterfaceFaultReference()
    {
        InterfaceFaultReference intFaultRef = null;
       
        if(fRef != null) //if 'ref' is null, we cannot match against an interface fault qname.
        {
            BindingOperation bindOp = (BindingOperation)getParent();
            InterfaceOperation intOp = bindOp.getInterfaceOperation();
            if(intOp != null)
            {
                //Determine the "effective" msg label for this binding fault ref.
                NCName effectiveMsgLabel = null;
                if(fMessageLabel != null)
                {
                    effectiveMsgLabel = fMessageLabel;
                }
                else
                {
                    //implement placeholder effective msg label, as per the todo comment above
                }
               
                //Now match the effective msg label against the msg label of an interface fault reference
                //that refers to an interface fault whose qname matches the 'ref' attribute.
                if(effectiveMsgLabel != null)
                {
                    InterfaceFaultReference[] intFaultRefs = intOp.getInterfaceFaultReferences();
                    for(int i=0; i<intFaultRefs.length; i++)
                    {
                        InterfaceFaultReference tempIntFaultRef = intFaultRefs[i];
                        InterfaceFault tempIntFault = tempIntFaultRef.getInterfaceFault();
                        QName intFaultName = (tempIntFault != null ? tempIntFault.getName() : null);
                        if(fRef.equals(intFaultName) &&
                           effectiveMsgLabel.equals(tempIntFaultRef.getMessageLabel()))
                        {
                            intFaultRef = tempIntFaultRef;
                            break;
                        }
                    }
View Full Code Here

  boolean duplicateFound = false;
  List specifiedInterfaceFaultReferences = new ArrayList();
  int numBindingFaultReferences = bindingFaultReferences.length;
  for(int i = 0; i < numBindingFaultReferences; i++)
  {
    InterfaceFaultReference interfaceFaultReference = bindingFaultReferences[i].getInterfaceFaultReference();
    if(interfaceFaultReference == null)
      continue;
    if(specifiedInterfaceFaultReferences.contains(interfaceFaultReference))
    {
    errorReporter.reportError(new ErrorLocatorImpl(), "BindingFaultReference-1055", new Object[]{interfaceFaultReference.getMessageLabel()}, ErrorReporter.SEVERITY_ERROR);
    duplicateFound = true;
    }
    else
    {
    specifiedInterfaceFaultReferences.add(interfaceFaultReference);
View Full Code Here

   * @return True if the binding fault reference specifies a valid interface fault reference, false otherwise.
   * @throws WSDLException
   */
  protected boolean testAssertionBindingFaultReference1059(BindingFaultReference bindingFaultReference, ErrorReporter errorReporter) throws WSDLException
  {
  InterfaceFaultReference interfaceFaultReference = bindingFaultReference.getInterfaceFaultReference();
  if(interfaceFaultReference == null)
  {
    errorReporter.reportError(new ErrorLocatorImpl(), "BindingFaultReference-1059", new Object[]{}, ErrorReporter.SEVERITY_ERROR);
      return false;
  }
View Full Code Here

        Arrays.sort(components, new Comparator() {

            public int compare(Object o1, Object o2) {

                InterfaceFaultReference i1 = (InterfaceFaultReference) o1;
                InterfaceFaultReference i2 = (InterfaceFaultReference) o2;

                InterfaceFault if1 = i1.getInterfaceFault();
                InterfaceFault if2 = i2.getInterfaceFault();

                if (if1 == if2)
                    return 0;
                if (if1 == null)
                    return -1;
                if (if2 == null)
                    return 1;

                QName q1 = if1.getName();
                QName q2 = if2.getName();

                int result = CmBaseWriter.compareQName(q1, q2);
                if (result != 0)
                    return result;

                String x1 = i1.getMessageLabel().toString();
                String x2 = i2.getMessageLabel().toString();
                return x1.compareTo(x2);
            }
        });

        out.beginElement(tag);
View Full Code Here

        Arrays.sort(components, new Comparator() {

            public int compare(Object o1, Object o2) {

                InterfaceFaultReference i1 = ((BindingFaultReference) o1)
                        .getInterfaceFaultReference();
                InterfaceFaultReference i2 = ((BindingFaultReference) o2)
                        .getInterfaceFaultReference();

                QName q1 = i1.getInterfaceFault().getName();
                QName q2 = i2.getInterfaceFault().getName();

                int result = CmBaseWriter.compareQName(q1, q2);
                if (result != 0)
                    return result;

                String x1 = i1.getMessageLabel().toString();
                String x2 = i2.getMessageLabel().toString();
                return x1.compareTo(x2);
            }
        });

        out.beginElement(tag);
View Full Code Here

        InterfaceFaultReference[] faults = operation.getInterfaceFaultReferences();
        for (int i = 0; i < faults.length; i++) {
            AxisMessage faultMessage = new AxisMessage();

            InterfaceFaultReference interfaceFaultReference = faults[i];
            faultMessage.setDirection(interfaceFaultReference.getDirection().toString());

            InterfaceFault interfaceFault = interfaceFaultReference.getInterfaceFault();

            faultMessage.setElementQName(interfaceFault.getElementDeclaration().getName());
            faultMessage.setName(interfaceFault.getName().getLocalPart());

            axisOperation.setFaultMessages(faultMessage);
View Full Code Here

        InterfaceFaultReference[] faults = operation.getInterfaceFaultReferences();
        for (int i = 0; i < faults.length; i++) {
            AxisMessage faultMessage = new AxisMessage();

            InterfaceFaultReference interfaceFaultReference = faults[i];
            faultMessage.setDirection(interfaceFaultReference.getDirection().toString());

            InterfaceFault interfaceFault = interfaceFaultReference.getInterfaceFault();

            if (interfaceFault == null) {
                throw new AxisFault("Interface Fault reference defined in operation " + opName + " cannot be found in interface");
            }
View Full Code Here

        InterfaceFaultReference[] faults = operation.getInterfaceFaultReferences();
        for (int i = 0; i < faults.length; i++) {
            AxisMessage faultMessage = new AxisMessage();

            InterfaceFaultReference interfaceFaultReference = faults[i];
            faultMessage.setDirection(interfaceFaultReference.getDirection().toString());

            InterfaceFault interfaceFault = interfaceFaultReference.getInterfaceFault();

            if (interfaceFault == null) {
                throw new AxisFault("Interface Fault reference defined in operation " + opName + " cannot be found in interface");
            }
View Full Code Here

TOP

Related Classes of org.apache.woden.wsdl20.InterfaceFaultReference

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.