Package org.apache.ws.java2wsdl.utils

Examples of org.apache.ws.java2wsdl.utils.TypeTable


        } catch (Exception e) {
            throw new AxisFault(e);
        }

        JMethod[] method = schemaGenerator.getMethods();
        TypeTable table = schemaGenerator.getTypeTable();

        PhasesInfo pinfo = axisConfig.getPhasesInfo();

        for (int i = 0; i < method.length; i++) {
            JMethod jmethod = method[i];
View Full Code Here


                axisService.getTargetNamespace())) {
            axisService.setTargetNamespace(schemaGenerator.getTargetNamespace());
        }

        JMethod [] method = schemaGenerator.getMethods();
        TypeTable table = schemaGenerator.getTypeTable();
        PhasesInfo pinfo = axisConfig.getPhasesInfo();


        for (int i = 0; i < method.length; i++) {
            JMethod jmethod = method[i];
            JAnnotation methodAnnon = jmethod.getAnnotation(AnnotationConstants.WEB_METHOD);
            if (methodAnnon != null) {
                if (methodAnnon.getValue(AnnotationConstants.EXCLUDE).asBoolean()) {
                    continue;
                }
            }
            if (!jmethod.isPublic()) {
                // no need to expose , private and protected methods
                continue;
            }
            if (excludeOperations != null && excludeOperations.contains(jmethod.getSimpleName())) {
                continue;
            }
            String opName = jmethod.getSimpleName();
            AxisOperation operation = axisService.getOperation(new QName(opName));
            // if the operation there in services.xml then try to set it schema element name
            if (operation != null) {
                AxisMessage inMessage = operation.getMessage(
                        WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                if (inMessage != null) {
                    inMessage.setName(opName + Java2WSDLConstants.MESSAGE_SUFFIX);
                    QName complexSchemaType = table.getComplexSchemaType(jmethod.getSimpleName());
                    inMessage.setElementQName(complexSchemaType);
                    if (complexSchemaType != null) {
                        axisService.addMessageElementQNameToOperationMapping(complexSchemaType,
                                                                             operation);
                    }
                }
                if (!jmethod.getReturnType().isVoidType()) {
                    AxisMessage outMessage = operation.getMessage(
                            WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                    QName qNamefortheType = table.getQNamefortheType(jmethod.getSimpleName() +
                            Java2WSDLConstants.RESPONSE);
                    outMessage.setElementQName(qNamefortheType);
                    if (qNamefortheType != null) {
                        axisService.addMessageElementQNameToOperationMapping(qNamefortheType,
                                                                             operation);
                    }
                    outMessage.setName(opName + Java2WSDLConstants.RESPONSE);
                }
                if (jmethod.getExceptionTypes().length > 0) {
                    JClass[] extypes = jmethod.getExceptionTypes() ;
                    for (int j= 0 ; j < extypes.length ; j++) {
                        AxisMessage faultMessage = new AxisMessage();
                        JClass extype = extypes[j] ;
                        String exname = extype.getSimpleName() ;
                        if(extypes.length>1){
                            faultMessage.setName(jmethod.getSimpleName() + "Fault" + j);
                        } else{
                            faultMessage.setName(jmethod.getSimpleName() + "Fault");
                        }
                        faultMessage.setElementQName(
                                table.getComplexSchemaType(exname + "Fault"));
                        operation.setFaultMessages(faultMessage);
                    }

                }
            } else {
View Full Code Here

TOP

Related Classes of org.apache.ws.java2wsdl.utils.TypeTable

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.