Package org.jibx.ws.wsdl.tools.custom

Examples of org.jibx.ws.wsdl.tools.custom.ServiceCustom


        InsertionOrderedSet concrs = new InsertionOrderedSet();
        ArrayList qnames = new ArrayList();
        List services = wsdlcustom.getServices();
        boolean doclit = m_generationParameters.isDocLit();
        for (Iterator iter = services.iterator(); iter.hasNext();) {
            ServiceCustom service = (ServiceCustom)iter.next();
            List ops = service.getOperations();
            for (Iterator iter1 = ops.iterator(); iter1.hasNext();) {
                OperationCustom op = (OperationCustom)iter1.next();
                List parms = op.getParameters();
                if (doclit && parms.size() > 1) {
                    System.err.println("Multiple parmameters not allowed for doc/lit: method " + op.getMethodName());
                }
                for (Iterator iter2 = parms.iterator(); iter2.hasNext();) {
                    ValueCustom parm = (ValueCustom)iter2.next();
                    if (doclit) {
                        accumulateData(parm, classelems, concrs);
                    } else {
                        accumulateData(parm, classtypes, abstrs);
                    }
                }
                if (doclit) {
                    accumulateData(op.getReturn(), classelems, concrs);
                } else {
                    accumulateData(op.getReturn(), classtypes, abstrs);
                }
                ArrayList thrws = op.getThrows();
                for (int i = 0; i < thrws.size(); i++) {
                   
                    // add concrete mapping for data type, if used
                    ThrowsCustom thrw = (ThrowsCustom)thrws.get(i);
                    FaultCustom fault = wsdlcustom.forceFaultCustomization(thrw.getType());
                    if (!concrs.contains(fault.getDataType())) {
                        concrs.add(fault.getDataType());
                        qnames.add(new QName(service.getNamespace(), fault.getElementName()));
                    }
                }
            }
        }
       
        // include extra classes as needing concrete mappings
        GlobalCustom global = m_generationParameters.getGlobal();
        for (int i = 0; i < extras.size(); i++) {
            String type = (String)extras.get(i);
            if (!concrs.contains(type)) {
                concrs.add(type);
                global.addClassCustomization(type);
                qnames.add(null);
            }
        }
       
        // generate bindings for all data classes used
        m_bindingGenerator.generateSpecified(qnames, concrs.asList(), abstrs.asList());
       
        // add binding definitions for collections passed or returned in plain doc/lit, and find empty service bindings
        Map typemap = new HashMap();
        Set unbounduris = new HashSet();
        for (Iterator iter = services.iterator(); iter.hasNext();) {
            ServiceCustom service = (ServiceCustom)iter.next();
            List ops = service.getOperations();
            String uri = service.getNamespace();
            BindingHolder hold = m_bindingGenerator.addBinding(uri, false);
            for (Iterator iter1 = ops.iterator(); iter1.hasNext();) {
                OperationCustom op = (OperationCustom)iter1.next();
                List parms = op.getParameters();
                for (Iterator iter2 = parms.iterator(); iter2.hasNext();) {
View Full Code Here


        Object item = extens.get(0);
        assertTrue("extension child type", item instanceof WsdlCustom);
        WsdlCustom wsdl = (WsdlCustom)item;
        List services = wsdl.getServices();
        assertEquals("service count", 1, services.size());
        ServiceCustom service = (ServiceCustom)services.get(0);
        assertEquals("service name", "Service1", service.getServiceName());
        assertEquals("service port", "Service1Port", service.getPortName());
        assertEquals("service binding", "Service1Binding", service.getBindingName());
        assertEquals("service portType", "Service1PortType", service.getPortTypeName());
        assertEquals("service wsdl namespace", "http://jibx.org/ws/wsdl/Service1", service.getWsdlNamespace());
        assertEquals("service schema namespace", "http://jibx.org/ws/wsdl/Service1", service.getNamespace());
        assertEquals("service address", "http://localhost:8080/axis2/services/Service1", service.getServiceAddress());
        List operations = service.getOperations();
        assertEquals("operation count", 7, operations.size());
        Map opmap = new HashMap();
        for (int i = 0; i < operations.size(); i++) {
            OperationCustom op = (OperationCustom)operations.get(i);
            opmap.put(op.getOperationName(), op);
View Full Code Here

        Object item = extens.get(0);
        assertTrue("extension child type", item instanceof WsdlCustom);
        WsdlCustom wsdl = (WsdlCustom)item;
        List services = wsdl.getServices();
        assertEquals("service count", 1, services.size());
        ServiceCustom service = (ServiceCustom)services.get(0);
        assertEquals("service name", "MyService", service.getServiceName());
        assertEquals("service port", "MyPort", service.getPortName());
        assertEquals("service binding", "MyBinding", service.getBindingName());
        assertEquals("service portType", "MyPortType", service.getPortTypeName());
        assertEquals("service wsdl namespace", "urn:a", service.getWsdlNamespace());
        assertEquals("service schema namespace", "urn:b", service.getNamespace());
        assertEquals("service address", "http://localhost:8080/jibxsoap/MyService", service.getServiceAddress());
        List operations = service.getOperations();
        assertEquals("operation count", 4, operations.size());
        Map opmap = new HashMap();
        for (int i = 0; i < operations.size(); i++) {
            OperationCustom op = (OperationCustom)operations.get(i);
            opmap.put(op.getOperationName(), op);
View Full Code Here

TOP

Related Classes of org.jibx.ws.wsdl.tools.custom.ServiceCustom

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.