Package org.apache.axis2.databinding.typemapping

Examples of org.apache.axis2.databinding.typemapping.TypeMappingRegistry


    private void send(MessageContext msgctx) throws AxisFault {

      // create the responseMessageContext and set that its related to the current outgoing
            // message, so that it could be tied back to the original request even if the response
            // envelope does not contain addressing headers
            MessageContext responseMessageContext = new MessageContext();
            responseMessageContext.setMessageID(msgctx.getMessageID());
            responseMessageContext.setProperty(
                    SynapseConstants.RELATES_TO_FOR_POX, msgctx.getMessageID());
            responseMessageContext.setOptions(options);
            responseMessageContext.setServerSide(true);
      addMessageContext(responseMessageContext);

            AxisEngine.send(msgctx);

            // did the engine receive a immediate synchronous response?
            // e.g. sometimes the transport sender may listen for a syncronous reply
      if (msgctx.getProperty(MessageContext.TRANSPORT_IN) != null) {

                responseMessageContext.setOperationContext(msgctx.getOperationContext());               
                responseMessageContext.setAxisMessage(
                    msgctx.getOperationContext().getAxisOperation().
                    getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
                responseMessageContext.setAxisService(msgctx.getAxisService());

                responseMessageContext.setProperty(MessageContext.TRANSPORT_OUT,
                    msgctx.getProperty(MessageContext.TRANSPORT_OUT));
                responseMessageContext.setProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO,
                    msgctx.getProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO));

                responseMessageContext.setProperty(
                    org.apache.synapse.SynapseConstants.ISRESPONSE_PROPERTY, Boolean.TRUE);
                responseMessageContext.setTransportIn(msgctx.getTransportIn());
                responseMessageContext.setTransportOut(msgctx.getTransportOut());

                // If request is REST assume that the responseMessageContext is REST too
                responseMessageContext.setDoingREST(msgctx.isDoingREST());

                responseMessageContext.setProperty(MessageContext.TRANSPORT_IN,
                    msgctx.getProperty(MessageContext.TRANSPORT_IN));
                responseMessageContext.setTransportIn(msgctx.getTransportIn());
                responseMessageContext.setTransportOut(msgctx.getTransportOut());

                // Options object reused above so soapAction needs to be removed so
                // that soapAction+wsa:Action on response don't conflict
                responseMessageContext.setSoapAction("");

                if (responseMessageContext.getEnvelope() == null) {
                    // If request is REST we assume the responseMessageContext is
                    // REST, so set the variable

                    SOAPEnvelope resenvelope =
                        TransportUtils.createSOAPMessage(responseMessageContext);

                    if (resenvelope != null) {
                        responseMessageContext.setEnvelope(resenvelope);
                        AxisEngine.receive(responseMessageContext);
                        if (responseMessageContext.getReplyTo() != null) {
                            sc.setTargetEPR(responseMessageContext.getReplyTo());
                        }

                        complete(msgctx);
                    } else {
                        throw new AxisFault(
View Full Code Here


        // mark the anon services created to be used in the client side of synapse as hidden
        // from the server side of synapse point of view
        anoymousService.getParent().addParameter(SynapseConstants.HIDDEN_SERVICE_PARAM, "true");
        ServiceGroupContext sgc = new ServiceGroupContext(
            axisCfgCtx, (AxisServiceGroup) anoymousService.getParent());
        ServiceContext serviceCtx = sgc.getServiceContext(anoymousService);

        boolean outOnlyMessage = "true".equals(synapseOutMessageContext.getProperty(
                SynapseConstants.OUT_ONLY)) || WSDL2Constants.MEP_URI_IN_ONLY.equals(
                originalInMsgCtx.getOperationContext()
                        .getAxisOperation().getMessageExchangePattern());
View Full Code Here

            AnonymousServiceFactory.getAnonymousService(synapseOutMessageContext.getConfiguration(),
            axisCfg, wsAddressingEnabled, wsRMEnabled, wsSecurityEnabled);
        // mark the anon services created to be used in the client side of synapse as hidden
        // from the server side of synapse point of view
        anoymousService.getParent().addParameter(SynapseConstants.HIDDEN_SERVICE_PARAM, "true");
        ServiceGroupContext sgc = new ServiceGroupContext(
            axisCfgCtx, (AxisServiceGroup) anoymousService.getParent());
        ServiceContext serviceCtx = sgc.getServiceContext(anoymousService);

        boolean outOnlyMessage = "true".equals(synapseOutMessageContext.getProperty(
                SynapseConstants.OUT_ONLY)) || WSDL2Constants.MEP_URI_IN_ONLY.equals(
                originalInMsgCtx.getOperationContext()
                        .getAxisOperation().getMessageExchangePattern());
View Full Code Here

        return desc;
    }

    private static void fillInTypeDesc(TypeDesc desc, Class beanClass)
            throws Exception {
        TypeMappingRegistry tmr = new TypeMappingRegistry();

        desc.setJavaClass(beanClass);

        BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
        PropertyDescriptor [] propDescs = beanInfo.getPropertyDescriptors();
        for (int i = 0; i < propDescs.length; i++) {
            PropertyDescriptor propDesc = propDescs[i];
            String name = propDesc.getName();

            if (name.equals("class"))
                continue;

            BeanPropertyDescriptor beanDesc = new BeanPropertyDescriptor();
            beanDesc.setReadMethod(propDesc.getReadMethod());
            beanDesc.setWriteMethod(propDesc.getWriteMethod());

            ElementDesc elDesc = desc.getElementDesc(name);
            boolean addDesc = true// Should we add this (new) element?
            if (elDesc == null) {
                elDesc = new ElementDesc();
                elDesc.setFieldName(name);
            } else {
                addDesc = false; // Already present, so don't add it again
            }
            Class type;
            boolean isCollection = false;
            if (propDesc instanceof IndexedPropertyDescriptor) {
                IndexedPropertyDescriptor iProp =
                        (IndexedPropertyDescriptor)propDesc;
                beanDesc.setIndexedReadMethod(iProp.getIndexedReadMethod());
                beanDesc.setIndexedWriteMethod(iProp.getIndexedWriteMethod());
                type = iProp.getIndexedPropertyType();
                elDesc.setIndexedAccessor(beanDesc);
                isCollection = true;
            } else {
                type = propDesc.getPropertyType();
                // TODO : check if this is a supported collection type
            }

            if (isCollection && elDesc.getMaxOccurs() == 0)
                elDesc.setMaxOccurs(-1);

            elDesc.setAccessor(beanDesc);

            if (elDesc.getQName() == null) {
                elDesc.setQName(new QName(name));
            }

            if (elDesc.getDeserializerFactory() == null) {
                DeserializerFactory dser = tmr.getDeserializerFactory(type);
                elDesc.setDeserializerFactory(dser);
            }

            if (elDesc.getRawSerializer() == null) {
                Serializer ser = tmr.getSerializer(type);
                elDesc.setSerializer(ser);
            }

            if (addDesc)
                desc.addField(elDesc);
View Full Code Here

        return desc;
    }

    private static void fillInTypeDesc(TypeDesc desc, Class beanClass)
            throws Exception {
        TypeMappingRegistry tmr = new TypeMappingRegistry();

        desc.setJavaClass(beanClass);

        BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
        PropertyDescriptor [] propDescs = beanInfo.getPropertyDescriptors();
        for (int i = 0; i < propDescs.length; i++) {
            PropertyDescriptor propDesc = propDescs[i];
            String name = propDesc.getName();

            if (name.equals("class"))
                continue;

            BeanPropertyDescriptor beanDesc = new BeanPropertyDescriptor();
            beanDesc.setReadMethod(propDesc.getReadMethod());
            beanDesc.setWriteMethod(propDesc.getWriteMethod());

            ElementDesc elDesc = desc.getElementDesc(name);
            boolean addDesc = true// Should we add this (new) element?
            if (elDesc == null) {
                elDesc = new ElementDesc();
                elDesc.setFieldName(name);
            } else {
                addDesc = false; // Already present, so don't add it again
            }
            Class type;
            boolean isCollection = false;
            if (propDesc instanceof IndexedPropertyDescriptor) {
                IndexedPropertyDescriptor iProp =
                        (IndexedPropertyDescriptor)propDesc;
                beanDesc.setIndexedReadMethod(iProp.getIndexedReadMethod());
                beanDesc.setIndexedWriteMethod(iProp.getIndexedWriteMethod());
                type = iProp.getIndexedPropertyType();
                elDesc.setIndexedAccessor(beanDesc);
                isCollection = true;
//                elDesc.setItemQName(new QName("http://foo", "item"));
            } else {
                type = propDesc.getPropertyType();
                // TODO : notice if this is a supported collection type
            }

            if (isCollection && elDesc.getMaxOccurs() == 0)
                elDesc.setMaxOccurs(-1);

            elDesc.setAccessor(beanDesc);

            if (elDesc.getQName() == null) {
                elDesc.setQName(new QName(name));
            }

            if (elDesc.getDeserializerFactory() == null) {
                DeserializerFactory dser = tmr.getDeserializerFactory(type);
                elDesc.setDeserializerFactory(dser);
            }

            if (elDesc.getRawSerializer() == null) {
                Serializer ser = tmr.getSerializer(type);
                elDesc.setSerializer(ser);
            }

            if (addDesc)
                desc.addField(elDesc);
View Full Code Here

        return desc;
    }

    private static void fillInTypeDesc(TypeDesc desc, Class beanClass)
            throws Exception {
        TypeMappingRegistry tmr = new TypeMappingRegistry();

        desc.setJavaClass(beanClass);

        BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
        PropertyDescriptor [] propDescs = beanInfo.getPropertyDescriptors();
        for (int i = 0; i < propDescs.length; i++) {
            PropertyDescriptor propDesc = propDescs[i];
            String name = propDesc.getName();

            if (name.equals("class"))
                continue;

            BeanPropertyDescriptor beanDesc = new BeanPropertyDescriptor();
            beanDesc.setReadMethod(propDesc.getReadMethod());
            beanDesc.setWriteMethod(propDesc.getWriteMethod());

            ElementDesc elDesc = desc.getElementDesc(name);
            boolean addDesc = true// Should we add this (new) element?
            if (elDesc == null) {
                elDesc = new ElementDesc();
                elDesc.setFieldName(name);
            } else {
                addDesc = false; // Already present, so don't add it again
            }
            Class type;
            boolean isCollection = false;
            if (propDesc instanceof IndexedPropertyDescriptor) {
                IndexedPropertyDescriptor iProp =
                        (IndexedPropertyDescriptor)propDesc;
                beanDesc.setIndexedReadMethod(iProp.getIndexedReadMethod());
                beanDesc.setIndexedWriteMethod(iProp.getIndexedWriteMethod());
                type = iProp.getIndexedPropertyType();
                elDesc.setIndexedAccessor(beanDesc);
                isCollection = true;
            } else {
                type = propDesc.getPropertyType();
                // TODO : notice if this is a supported collection type
            }

            if (isCollection && elDesc.getMaxOccurs() == 0)
                elDesc.setMaxOccurs(-1);

            elDesc.setAccessor(beanDesc);

            if (elDesc.getQName() == null) {
                elDesc.setQName(new QName(name));
            }

            if (elDesc.getDeserializerFactory() == null) {
                DeserializerFactory dser = tmr.getDeserializerFactory(type);
                elDesc.setDeserializerFactory(dser);
            }

            if (elDesc.getRawSerializer() == null) {
                Serializer ser = tmr.getSerializer(type);
                elDesc.setSerializer(ser);
            }

            if (addDesc)
                desc.addField(elDesc);
View Full Code Here

            deploymentFileData.setClassLoader(isDirectory, getClass().getClassLoader(),
                    (File) cfgCtx.getAxisConfiguration().getParameterValue(
                            Constants.Configuration.ARTIFACTS_TEMP_DIR),
                    cfgCtx.getAxisConfiguration().isChildFirstClassLoading());

            DeploymentClassLoader urlCl
                = (DeploymentClassLoader)deploymentFileData.getClassLoader();
            Thread.currentThread().setContextClassLoader(urlCl);

            // StartupFactory registration
            for (StartupFactory factory : getProviders(StartupFactory.class, urlCl)) {
View Full Code Here

    private void handleException(String message, Exception e) throws DeploymentException {
        if (log.isDebugEnabled()) {
            log.debug(message, e);
        }
        throw new DeploymentException(message, e);
    }
View Full Code Here

    private void handleException(String message, Throwable t) throws DeploymentException {
        if (log.isDebugEnabled()) {
            log.debug(message, t);
        }
        throw new DeploymentException(message, t);
    }
View Full Code Here

            }
        } else {
            String msg = "Artifact representing the filename "
                    + fileName + " is not deployed on Synapse";
            log.error(msg);
            throw new DeploymentException(msg);
        }

        if (log.isDebugEnabled()) {
            log.debug("UnDeployment of the synapse artifact from file : "
                    + fileName + " : COMPLETED");
View Full Code Here

TOP

Related Classes of org.apache.axis2.databinding.typemapping.TypeMappingRegistry

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.