public static void main(String[] args) throws Exception {

       p1 = new WsdlParser("drink3.wsdl");

       p2 = new WsdlParser("wine3.wsdl");

        List<OperationImpl> arropout = p1.getOperations();

        //     for (OperationImpl op : arropout) {
        //         System.out.println(op.getName());
        //}
        List<OperationImpl> arropin = p2.getOperations();
        //for (OperationImpl op : arropin) {
        // System.out.println(op.getName());
        //}





        QName qsave = null;
        for (OperationImpl opout : arropout) {

            System.out.println("    OPERATION:  " + opout.getName());

            ArrayList<QName> outElements = p1.getOutputElements(opout);

            for (QName q : outElements) {
//                System.out.println("out: "+  q.getLocalPart());
            }

            for (OperationImpl opin : arropin) {
                ArrayList<QName> inputElements = p2.getInputElements(opin);


                for (QName q1 : outElements) {

                    ArrayList<String> elementsMatchingQnamesOUT = p1.getElementsMatchingQnames(q1);

                    for (QName q2 : inputElements) {

                        System.out.println("    OPOUT: " + opout.getName() + " OPin " + opin.getName());
                        q2.equals(q2);
                        //System.out.println("comparing " + q1.getLocalPart() + " and " + q2.getLocalPart() + " \n");


                        ArrayList<String> elementsMatchingQnamesIN = p2.getElementsMatchingQnames(q2);
                        //System.out.println("opin: " + opin.getName() + " opout: " + opout.getName());
                        //System.out.println("qname in: " + q2.getLocalPart());
                        cmpArrays(elementsMatchingQnamesIN, opin.getName(), elementsMatchingQnamesOUT, opout.getName());
                        qsave = q2;
                    }
                }


            }
        }


        int count = 0;
        double sum = 0.0;
        for (MatchedOperationType mo : t.getMacthedOperation()) {
            sum += mo.getOpScore();
            count++;
        }
        t.setWsScore(sum / count);

        matching.addMatchedWebServiceType(t);

        File file = new File("output.xml");
        JAXBContext jc = JAXBContext.newInstance("hw4.generated");
        Marshaller marshaller = jc.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
        marshaller.marshal(new JAXBElement<WSMatchingType>(new QName("ns2:WSMatching"), WSMatchingType.class, matching), file);


        /*System.out.println("qsave: " + qsave.getLocalPart()+"\n");
         ArrayList<String> elementsMatchingQnames = p1.getElementsMatchingQnames(qsave);
         for(String s : elementsMatchingQnames){
         System.out.println(s);
         }*/



    }