Package org.apache.axis2.description.java2wsdl

Examples of org.apache.axis2.description.java2wsdl.TypeTable


        if (axisService.isCustomWsdl()) {
            OMElement package2QName = createOMElement(fac, ns,
                                                      DeploymentConstants.TAG_PACKAGE2QNAME);
            serviceEle.addChild(package2QName);
            TypeTable typeTable = axisService.getTypeTable();
            if (typeTable != null) {
                Map complexSchemaMap = typeTable.getComplexSchemaMap();
                Set complexSchemaSet = complexSchemaMap.entrySet();
                for (Iterator iterator = complexSchemaSet.iterator(); iterator.hasNext();) {
                    Map.Entry me = (Map.Entry) iterator.next();
                    String packageKey = (String) me.getKey();
                    QName qName = (QName) me.getValue();
View Full Code Here


                OMAttribute omAttribute = omElement.getAttribute(new QName("http://www.w3.org/2001/XMLSchema-instance", "type"));
                if (omAttribute != null) {
                    String value = omAttribute.getAttributeValue();
                    if (value != null && !value.trim().equals("")) {
                        String[] strings = value.split(":");
                        TypeTable table = new TypeTable();
                        QName qName = table.getQNamefortheType(strings[1]);
                        return createParam(omElement, qName, engine);
                    }
                }
                return omElement.getText();
            } else {
View Full Code Here

            child.addChild(fac.createOMText(child, enumValue.getValueAsString()));
        }
    }

    private static OMNamespace getNameSpaceForType(SOAPFactory fac, AxisService service, CompositeDataType dataType) {
        TypeTable typeTable = service.getTypeTable();
        String fullname = (dataType.getModule()!=null) ? dataType.getModule() + dataType.getName() : dataType.getName();
        fullname = fullname.replaceAll(CompositeDataType.MODULE_SEPERATOR, ".");
        QName qname = typeTable.getQNamefortheType(fullname);
        if (qname==null)
            return null;
        return fac.createOMNamespace(qname.getNamespaceURI(), qname.getPrefix());
    }
View Full Code Here

        }

        Interface intf = (Interface) idl.getInterfaces().get(interfaceName);
        Operation[] operations = intf.getOperations();

        TypeTable table = schemaGenerator.getTypeTable();
        PhasesInfo pinfo = axisConfig.getPhasesInfo();

        for (int i = 0; i < operations.length; i++) {
            Operation corbaOperation = operations[i];
            String opName = corbaOperation.getName();
            if (excludeOperations != null && excludeOperations.contains(opName)) {
                continue;
            }
            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(opName);
                    inMessage.setElementQName(complexSchemaType);
                    if (complexSchemaType != null) {
                        axisService.addMessageElementQNameToOperationMapping(complexSchemaType,
                                operation);
                    }
                }
                DataType returnType = corbaOperation.getReturnType();
                if (returnType != null && !CorbaUtil.getQualifiedName(returnType).equals(VOID)) {
                    AxisMessage outMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                    QName qNamefortheType = table.getQNamefortheType(opName + RESPONSE);
                    outMessage.setElementQName(qNamefortheType);
                    if (qNamefortheType != null) {
                        axisService.addMessageElementQNameToOperationMapping(qNamefortheType, operation);
                    }
                    outMessage.setName(opName + RESPONSE);
                }
                if (corbaOperation.hasRaises()) {
                    List extypes = corbaOperation.getRaises();
                    for (int j = 0; j < extypes.size(); j++) {
                        AxisMessage faultMessage = new AxisMessage();
                        ExceptionType extype = (ExceptionType) extypes.get(j);
                        String exname = extype.getName() ;
                        if(extypes.size()>1){
                            faultMessage.setName(opName + FAULT + j);
                        } else{
                            faultMessage.setName(opName + FAULT);
                        }
                        faultMessage.setElementQName(
                                table.getComplexSchemaType(exname + FAULT));
                        operation.setFaultMessages(faultMessage);
                    }

                }
            } else {
View Full Code Here

            Class[] exceptionTypes = method.getExceptionTypes();
            for (Class exceptionType : exceptionTypes){
                if (exceptionType.getName().equals(cause.getClass().getName())){
                    // this is an bussiness logic exception so handle it properly
                    String partQName = inMessage.getAxisService().getName() + getSimpleClassName(exceptionType);
                    TypeTable typeTable = inMessage.getAxisService().getTypeTable();
                    QName elementQName = typeTable.getQNamefortheType(partQName);
                    SOAPFactory fac = getSOAPFactory(inMessage);
                    OMElement exceptionElement = fac.createOMElement(elementQName);

                    if (exceptionType.getName().equals(Exception.class.getName())){
                        // this is an exception class. so create a element by hand and add the message
View Full Code Here

                // to get the type table.
                if (messageContext != null) {
                    AxisService axisService = messageContext.getAxisService();
                    if (axisService != null) {
                        QName typeQName = beanElement.resolveQName(instanceTypeName);
                        TypeTable typeTable = axisService.getTypeTable();
                        String className = typeTable.getClassNameForQName(typeQName);
                        if (className != null) {
                            try {
                                beanClass = Loader.loadClass(axisService.getClassLoader(), className);
                            } catch (ClassNotFoundException ce) {
                                throw AxisFault.makeFault(ce);
View Full Code Here

   *            OMElement for the packageMappingElement
   */
  private void processTypeMappings(OMElement packageMappingElement) {
    Iterator elementItr = packageMappingElement
        .getChildrenWithName(new QName(TAG_MAPPING));
    TypeTable typeTable = service.getTypeTable();
    if (typeTable == null) {
      typeTable = new TypeTable();
    }
    while (elementItr.hasNext()) {
      OMElement mappingElement = (OMElement) elementItr.next();
      String packageName = mappingElement.getAttributeValue(new QName(
          TAG_PACKAGE_NAME));
      String qName = mappingElement
          .getAttributeValue(new QName(TAG_QNAME));
      if (packageName == null || qName == null) {
        continue;
      }
      Iterator keys = service.getNamespaceMap().keySet().iterator();
      while (keys.hasNext()) {
        String key = (String) keys.next();
        if (qName.equals(service.getNamespaceMap().get(key))) {
          typeTable.addComplexSchema(packageName, new QName(qName,
              packageName, key));
        }
      }
    }
    service.setTypeTable(typeTable);
View Full Code Here

     *
     * @param packageMappingElement OMElement for the packageMappingElement
     */
    private void processTypeMappings(OMElement packageMappingElement) {
        Iterator elementItr = packageMappingElement.getChildrenWithName(new QName(TAG_MAPPING));
        TypeTable typeTable = service.getTypeTable();
        if (typeTable == null) {
            typeTable = new TypeTable();
        }
        while (elementItr.hasNext()) {
            OMElement mappingElement = (OMElement) elementItr.next();
            String packageName = mappingElement.getAttributeValue(new QName(TAG_PACKAGE_NAME));
            String qName = mappingElement.getAttributeValue(new QName(TAG_QNAME));
            if (packageName == null || qName == null) {
                continue;
            }
            Iterator keys = service.getNamespaceMap().keySet().iterator();
            while (keys.hasNext()) {
                String key = (String) keys.next();
                if (qName.equals(service.getNamespaceMap().get(key))) {
                    typeTable.addComplexSchema(packageName,
                                               new QName(qName, packageName, key));
                }
            }
        }
        service.setTypeTable(typeTable);
View Full Code Here

   *            OMElement for the packageMappingElement
   */
  private void processTypeMappings(OMElement packageMappingElement) {
    Iterator elementItr = packageMappingElement
        .getChildrenWithName(new QName(TAG_MAPPING));
    TypeTable typeTable = service.getTypeTable();
    if (typeTable == null) {
      typeTable = new TypeTable();
    }
    while (elementItr.hasNext()) {
      OMElement mappingElement = (OMElement) elementItr.next();
      String packageName = mappingElement.getAttributeValue(new QName(
          TAG_PACKAGE_NAME));
      String qName = mappingElement
          .getAttributeValue(new QName(TAG_QNAME));
      if (packageName == null || qName == null) {
        continue;
      }
      Iterator keys = service.getNamespaceMap().keySet().iterator();
      while (keys.hasNext()) {
        String key = (String) keys.next();
        if (qName.equals(service.getNamespaceMap().get(key))) {
          typeTable.addComplexSchema(packageName, new QName(qName,
              packageName, key));
        }
      }
    }
    service.setTypeTable(typeTable);
View Full Code Here

        }

        Interface intf = (Interface) idl.getInterfaces().get(interfaceName);
        Operation[] operations = intf.getOperations();

        TypeTable table = schemaGenerator.getTypeTable();
        PhasesInfo pinfo = axisConfig.getPhasesInfo();

        for (int i = 0; i < operations.length; i++) {
            Operation corbaOperation = operations[i];
            String opName = corbaOperation.getName();
            if (excludeOperations != null && excludeOperations.contains(opName)) {
                continue;
            }
            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(opName);
                    inMessage.setElementQName(complexSchemaType);
                    if (complexSchemaType != null) {
                        axisService.addMessageElementQNameToOperationMapping(complexSchemaType,
                                operation);
                    }
                }
                DataType returnType = corbaOperation.getReturnType();
                if (returnType != null && !CorbaUtil.getQualifiedName(returnType).equals(VOID)) {
                    AxisMessage outMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                    QName qNamefortheType = table.getQNamefortheType(opName + RESPONSE);
                    outMessage.setElementQName(qNamefortheType);
                    if (qNamefortheType != null) {
                        axisService.addMessageElementQNameToOperationMapping(qNamefortheType, operation);
                    }
                    outMessage.setName(opName + RESPONSE);
                }
                if (corbaOperation.hasRaises()) {
                    List extypes = corbaOperation.getRaises();
                    for (int j = 0; j < extypes.size(); j++) {
                        AxisMessage faultMessage = new AxisMessage();
                        ExceptionType extype = (ExceptionType) extypes.get(j);
                        String exname = extype.getName() ;
                        if(extypes.size()>1){
                            faultMessage.setName(opName + FAULT + j);
                        } else{
                            faultMessage.setName(opName + FAULT);
                        }
                        faultMessage.setElementQName(
                                table.getComplexSchemaType(exname + FAULT));
                        operation.setFaultMessages(faultMessage);
                    }

                }
            } else {
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.java2wsdl.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.