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

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


                def.addNamespace(rselem.getUri());
            }
           
            // process fault message(s) for operation
            ArrayList thrws = odef.getThrows();
            WsdlCustom wsdlcustom = m_generationParameters.getWsdlCustom();
            for (int j = 0; j < thrws.size(); j++) {
                ThrowsCustom thrw = (ThrowsCustom)thrws.get(j);
                String type = thrw.getType();
                Message fmsg = (Message)fltmap.get(type);
                if (fmsg == null) {
                   
                    // first time for this throwable, create the message
                    FaultCustom fault = wsdlcustom.forceFaultCustomization(type);
                    QName fqname = new QName(sns, fault.getElementName());
                    MessagePart part = new MessagePart("fault", fqname);
                    fmsg = new Message(fault.getFaultName(), wns);
                    fmsg.getParts().add(part);
                    def.addMessage(fmsg);
View Full Code Here


     */
    private List generate(List classes, List extras, Map classelems, Map elemschemas, Map classtypes, Map typeschemas,
        Collection exists) throws JiBXException, IOException {
       
        // add any service classes not already present in customizations
        WsdlCustom wsdlcustom = m_generationParameters.getWsdlCustom();
        for (int i = 0; i < classes.size(); i++) {
            String sclas = (String)classes.get(i);
            if (wsdlcustom.getServiceCustomization(sclas) == null) {
                wsdlcustom.addServiceCustomization(sclas);
            }
        }
       
        // accumulate unmapped data classes used by all service operations
        // TODO: throws class handling, with multiple services per WSDL
        InsertionOrderedSet abstrs = new InsertionOrderedSet();
        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()));
                    }
                }
View Full Code Here

            ictx.setUserContext(vctx);
            ((IUnmarshallable)m_global).unmarshal(ictx);
        }
       
        // find or build WSDL customization
        WsdlCustom custom = null;
        List extens = m_global.getExtensionChildren();
        for (Iterator iter = extens.iterator(); iter.hasNext();) {
            Object exten = iter.next();
            if (exten instanceof WsdlCustom) {
                custom = (WsdlCustom)exten;
                break;
            }
        }
        if (custom == null) {
            custom = new WsdlCustom(m_global);
            m_global.addExtensionChild(custom);
        }
        m_wsdlCustom = custom;
    }
View Full Code Here

        GlobalCustom custom = readCustom(SIMPLE_SERVICE_CLASS);
        List extens = custom.getExtensionChildren();
        assertEquals("extension count", 1, extens.size());
        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());
View Full Code Here

        GlobalCustom custom = readCustom(CUSTOMIZED_SERVICE_CLASS1);
        List extens = custom.getExtensionChildren();
        assertEquals("extension count", 1, extens.size());
        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());
View Full Code Here

TOP

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

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.