Package org.apache.axis2.description.java2wsdl

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


            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


   *            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

   *            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

                // 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(beanClass.getClassLoader(), className);
                            } catch (ClassNotFoundException ce) {
                                throw AxisFault.makeFault(ce);
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

     */
    public void testGetOMElementWithDataHandlerArg() {
        DataHandler dh = new DataHandler(new ByteArrayDataSource(new byte[4096],
                "application/octet-stream"));
        OMElement element = BeanUtil.getOMElement(new QName("urn:ns1", "myop"),
                new Object[] { dh }, new QName("urn:ns1", "part"), true, new TypeTable());
        OMText text = (OMText)element.getFirstElement().getFirstOMChild();
        assertTrue(text.isOptimized());
        assertSame(dh, text.getDataHandler());
    }
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

                throw new AxisFault("can't find the data type of the returned value.");
            }

            Object value = CorbaUtil.extractValue(contentDataType, any);

            TypeTable typeTable = service.getTypeTable();
            QName anySchema = typeTable.getComplexSchemaType(CorbaConstants.ANY_TYPE_NAME);
            if (anySchema == null) {
                throw new AxisFault("CORBA.Any schema type is not defined.");
            }
            String defaultNSURI = anySchema.getNamespaceURI();
            String defaultNSPrefix = anySchema.getPrefix();
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.