Package org.jboss.ws.tools.exceptions

Examples of org.jboss.ws.tools.exceptions.JBossWSToolsException


         Class factoryClass = loader.loadClass(factoryName);
         factory = (JavaToXSDFactory) factoryClass.newInstance();
      }
      catch(Throwable e)
      {
         throw new JBossWSToolsException("Cannot create JavaToXSDFactory",e);
      }
      return factory;
   }
View Full Code Here


         Class factoryClass = loader.loadClass(factoryName);
         factory = (JavaToXSDFactory) factoryClass.newInstance();
      }
      catch(Throwable e)
      {
         throw new JBossWSToolsException("Cannot create JavaToXSDFactory",e);
      }
      return factory;
   }
View Full Code Here

   {
      WSDLInterface[] intf1 = w1.getInterfaces();
      WSDLInterface[] intf2 = w2.getInterfaces();

      if(intf1.length != intf2.length)
         throw new JBossWSToolsException("Number of portType operations in wsdl mismatch");

      int len = intf1.length;
      for (int i = 0; i < len; i++)
      {
         WSDLInterface i1 = intf1[i];
         WSDLInterface i2 = intf2[i];
         WSDLInterfaceOperation[] ops1 = i1.getSortedOperations();
         WSDLInterfaceOperation[] ops2 = i2.getSortedOperations();

         int lenOps = ops1.length;
         for (int j = 0; j < lenOps; j++)
         {
            if(validateMessage(ops1[j],ops2[j]) == false)
            {
               log.error("Validation of Messages failed");
               throw new JBossWSToolsException("Validation of messages failed");
            }
         }//end for

         // Append the Faults
         WSDLInterfaceFault[] faults1 = i1.getFaults();
         WSDLInterfaceFault[] faults2 = i2.getFaults();
         int lenf = faults1 != null ? faults1.length : 0;
         for (int k = 0; k < lenf; k++)
         {
            WSDLInterfaceFault flt1 = faults1[k];
            WSDLInterfaceFault flt2 = faults2[k];
            QName elt = flt1.getElement();
            QName elt2 = flt2.getElement();
            if(!(elt.getLocalPart().equals(elt2.getLocalPart()) &&
                  elt.getNamespaceURI().equals(elt2.getNamespaceURI())))
            {
               log.error("Faults do not match");
               throw new JBossWSToolsException("Validation of faults failed:"+elt.getLocalPart());
            }

         }
      }//end for
      return true;
View Full Code Here

      String op1name = op1.getName().getLocalPart();
      String intf1name = op1.getWsdlInterface().getName().toString();
      String op2name = op2.getName().getLocalPart();
      String intf2name = op2.getWsdlInterface().getName().toString();
      if(op1name.equals(op2name) == false)
         throw new JBossWSToolsException(op1name + " does not match with " + op2name);
      if( intf1name.equals(intf2name) == false)
         throw new JBossWSToolsException(intf1name + " does not match with " + intf2name);

      WSDLInterfaceOperationInput[] inputs1 = op1.getInputs();
      WSDLInterfaceOperationInput[] inputs2 = op2.getInputs();
      int lenin1 = inputs1.length;
      for (int i = 0; i < lenin1; i++)
      {
         WSDLInterfaceOperationInput input1 = inputs1[i];
         WSDLInterfaceOperationInput input2 = inputs2[i];
         if(validateInputParts(input1, input2) == false)
            throw new JBossWSToolsException("Validation of input parts failed:" + input1.getElement());
      }

      //Now the return type
      WSDLInterfaceOperationOutput[] outputs1 = op1.getOutputs();
      WSDLInterfaceOperationOutput[] outputs2 = op2.getOutputs();
      int lenout = outputs1.length;

      if(lenout != outputs2.length)
         throw new JBossWSToolsException("Length of operation outputs do not match");

      for (int i = 0; i < lenout; i++)
      {
            WSDLInterfaceOperationOutput out1 = outputs1[i];
            WSDLInterfaceOperationOutput out2 = outputs2[i];
            if(validateOutputParts(out1, out2) == false)
               throw new JBossWSToolsException("Validation of output parts failed:" + out1);
      }
      return true;
   }
View Full Code Here

      boolean bool = false;
      if(x1==null && x2 == null) return true;
      this.checkNullParametersInconsistency(x1,x2,XSTypeDefinition.class);

      if(x1.getName().equals(x2.getName()) == false)
         throw new JBossWSToolsException("Validation of XSType failed:"
                     + x1.getName() + ":" + x2.getName());
      //TODO: Expand comparison of types to include attributes/elements
      if(x1 instanceof XSComplexTypeDefinition &&
            x2 instanceof XSComplexTypeDefinition)
      {
View Full Code Here

   boolean bool = true;
      WSDLBinding[] bindings1 = w1.getBindings();
      WSDLBinding[] bindings2 = w2.getBindings();
      if (bindings1 == null || bindings1.length == 0)
      {
         throw new JBossWSToolsException("bindings in first wsdl cannot be null");
      }
      if(bindings2 == null || bindings2.length == 0)
      {
         throw new JBossWSToolsException("bindings in second wsdl cannot be null");
      }
      if(bindings1.length != bindings2.length)
         throw new JBossWSToolsException("Mismatch in the number of bindings");
     
      for (int i = 0; i < bindings1.length; i++)
      {
         WSDLBinding binding1 = bindings1[i];
         WSDLBinding binding2 = bindings2[i];
View Full Code Here

     
      WSDLInterface[] wiarr1 = w1.getInterfaces();
      WSDLInterface[] wiarr2 = w2.getInterfaces();
     
      if(wiarr1.length != wiarr2.length)
         throw new JBossWSToolsException("Number of interfaces mismatch");
     
      int len = wiarr1.length;
     
      for(int i = 0; i < len; i++)
      {
         WSDLInterface wi1 = wiarr1[i];
         WSDLInterface wi2 = wiarr2[i];
         if(checkQNameEquality(wi1.getName(),wi2.getName()) == false)
            throw new JBossWSToolsException("Interface mismatch");
         WSDLInterfaceOperation[] wioparr1 = wi1.getOperations();
         WSDLInterfaceOperation[] wioparr2 = wi2.getOperations();
        
         if(wioparr1.length != wioparr2.length)
            throw new JBossWSToolsException("Number of Interface Operations mismatch");
         int innerlen = wioparr1.length;
         for(int j = 0 ; j< innerlen; j++)
         {
            bool = validateInterfaceOperation(wioparr1[j],wioparr2[j]);
            if(bool == false)
               throw new JBossWSToolsException("validation Interface Operations failed");
         }
      }
      return bool;
   }
View Full Code Here

            ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY));
      List<WSDLExtensibilityElement> pol2 = new ArrayList<WSDLExtensibilityElement>(
            ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY));
      //check whether lists are the same size
      if (pol1.size() != pol2.size())
         throw new JBossWSToolsException("Policy WSDLExtensibilityElement mismatch!");
      //check equality
      for (WSDLExtensibilityElement el1 : pol1)
      {
         boolean done = false;
         Iterator it = pol2.iterator();
         WSDLExtensibilityElement el2 = null;
         while (it.hasNext() && !done)
         {
            el2 = (WSDLExtensibilityElement)it.next();
            done = (el1.isRequired() == el2.isRequired()) &&
               checkElementEquality(el1.getElement(), el2.getElement());
         }
         if (!done)
         {
            log.error("Failing policy validation on policy on: "+ext1+" and "+ext2);
            return false;
         }
         pol2.remove(el2);
      }
      //policy references
      List<WSDLExtensibilityElement> polRef1 = new ArrayList<WSDLExtensibilityElement>(
            ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
      List<WSDLExtensibilityElement> polRef2 = new ArrayList<WSDLExtensibilityElement>(
            ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
      //check whether lists are the same size
      if (polRef1.size() != polRef2.size())
         throw new JBossWSToolsException("Policy ref WSDLExtensibilityElement mismatch!");
      //check equality
      for (WSDLExtensibilityElement el1 : polRef1)
      {
         boolean done = false;
         Iterator it = polRef2.iterator();
         WSDLExtensibilityElement el2 = null;
         while (it.hasNext() && !done)
         {
            el2 = (WSDLExtensibilityElement)it.next();
            done = (el1.isRequired() == el2.isRequired()) &&
               checkElementEquality(el1.getElement(), el2.getElement());
         }
         if (!done)
         {
            log.error("Failing policy validation on policy ref on: "+ext1+" and "+ext2);
            return false;
         }
         polRef2.remove(el2);
      }
      //check properties
      WSDLProperty prop1 = ext1.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
      WSDLProperty prop2 = ext2.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
      if (prop1 != null || prop2 != null)
      {
         if (prop1 == null || prop2 == null || prop1.isRequired() != prop2.isRequired())
            throw new JBossWSToolsException("Policy prop WSDLExtensibilityElement mismatch!");
         String value1 = prop1.getValue();
         String value2 = prop2.getValue();
         if (value1 != null || value2 != null)
         {
            if (value1 == null || value2 == null || !value1.equalsIgnoreCase(value2))
View Full Code Here

   throws JBossWSToolsException
   {
      String ts1 = w1.getTargetNamespace();
      String ts2 = w2.getTargetNamespace();
      if(ts1 == null || ts1.equals(""))
         throw new JBossWSToolsException("Target Namespaces 1 is null");
      if(ts2 == null || ts2.equals(""))
         throw new JBossWSToolsException("Target Namespaces 2 is null");
      if(ts1.equals(ts2) == false)
         throw new JBossWSToolsException("Target Namespaces do not match");
     
      Iterator iter1 = w1.getRegisteredPrefix();
     
      /**
       * IDEA: We get a namespace from the first wsdl and check that it is defined
       * in the other wsdl, irrespective of the prefix match
       */
      while(iter1.hasNext())
      {
         String prefix1 = (String)iter1.next();
        
         String ns = w1.getNamespaceURI(prefix1);
        
         //Ignore the namespaces that are generated by wscompile for arrays
         if(ns.indexOf("arrays") > -1 )
            continue;
        
         String prefix2 = w2.getPrefix(ns);
        
         if(prefix2 == null)
            throw new JBossWSToolsException("Namespace " + ns + " not defined in the second wsdl");   
      }
     
      //Lets check the prefixes and namespaces
      /*while(iter1.hasNext() && iter2.hasNext())
      {
View Full Code Here

      boolean bool = false;
      WSDLService[] services1 = w1.getServices();
      WSDLService[] services2 = w2.getServices();
      if (services1 == null || services1.length == 0)
      {
         throw new JBossWSToolsException("services in first wsdl cannot be null");
      }
      if(services2 == null || services2.length == 0)
      {
         throw new JBossWSToolsException("services in second wsdl cannot be null");
      }
      if(services1.length != services2.length)
         throw new JBossWSToolsException("Mismatch in the number of services");
     
      for (int i = 0; i < services1.length; i++)
      {
         WSDLService s1 = services1[i];
         WSDLService s2 = services2[i];
View Full Code Here

TOP

Related Classes of org.jboss.ws.tools.exceptions.JBossWSToolsException

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.