Package org.apache.axis.encoding

Examples of org.apache.axis.encoding.SerializationContextImpl


    public void writeTo(Writer writer) throws IOException {

        if ( currentForm == FORM_FAULT ) {
            AxisFault env = (AxisFault)currentMessage;
            try {
                env.output(new SerializationContextImpl(writer, getMessage().getMessageContext()));
            } catch (Exception e) {
                log.error(Messages.getMessage("exception00"), e);
                throw env;
            }
            return;
        }

        if ( currentForm == FORM_SOAPENVELOPE ) {
            SOAPEnvelope env = (SOAPEnvelope)currentMessage;
            try {
                env.output(new SerializationContextImpl(writer, getMessage().getMessageContext()));
            } catch (Exception e) {
                throw AxisFault.makeFault(e);
            }
            return;
        }
View Full Code Here


        RPCParam arg2 = new RPCParam("", "struct", data);
        RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ arg1, arg2 });
        msg.addBodyElement(body);

        Writer stringWriter = new StringWriter();
        SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
        context.setDoMultiRefs(multiref);

        // Create a TypeMapping and register the specialized Type Mapping
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        tm.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
        reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);

        QName dataQName = new QName("typeNS", "Data");
View Full Code Here

            RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[] { arg1 });
            msg.addBodyElement(body);
            body.setEncodingStyle(Constants.URI_LITERAL_ENC);

            SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
            msg.output(context);

            msgString = stringWriter.toString();
            assertTrue(msgString.indexOf("xmlns=\"\"")==-1);
        } catch (Exception e) {
View Full Code Here

        // For debugging - print request message
        if (log.isDebugEnabled()) {
            StringWriter writer = new StringWriter();
            try {
                SerializationContext ctx = new SerializationContextImpl(writer,
                                                                   msgContext);
                reqEnv.output(ctx);
                writer.close();
            } catch (Exception e) {
                log.debug(JavaUtils.getMessage("exceptionPrinting"), e);
View Full Code Here

        return deployment;
    }

    public Document getDOMDocument() throws ConfigurationException {
        StringWriter writer = new StringWriter();
        SerializationContext context = new SerializationContextImpl(writer, null);
        context.setPretty(true);
        try {
            deployment.writeToContext(context);
        } catch (Exception e) {
            log.error(JavaUtils.getMessage("exception00"), e);
        }
View Full Code Here

     */
    public static Document listConfig(AxisEngine engine)
        throws AxisFault
    {
        StringWriter writer = new StringWriter();
        SerializationContext context = new SerializationContextImpl(writer, null);
        context.setPretty(true);
        try {
            FileProvider config = (FileProvider)engine.getConfig();
            WSDDDeployment deployment = config.getDeployment();
            deployment.writeToContext(context);
        } catch (Exception e) {
View Full Code Here

        if (context != null) {
            msgContext = context.getMessageContext();
        } else {
            msgContext = MessageContext.getCurrentContext();
        }
        serializeContext = new SerializationContextImpl(writer, msgContext);
        serializeContext.setSendDecl(false);
        output(serializeContext);
        writer.close();

        return writer.getBuffer().toString();
View Full Code Here

        try {
            Reader reader = null;
           
            if (args.length == 0) {
                Writer stringWriter = new StringWriter();
                SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
               
                TypeMappingRegistry reg = context.getTypeMappingRegistry();
                TypeMapping tm = (TypeMapping) reg.getTypeMapping(Constants.URI_SOAP11_ENC);
                if (tm == null) {
                    tm = (TypeMapping) reg.createTypeMapping();
                    reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
                }
View Full Code Here

        RPCParam arg2 = new RPCParam("", "struct", data);
        RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ arg1, arg2 });
        msg.addBodyElement(body);

        Writer stringWriter = new StringWriter();
        SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
        context.setDoMultiRefs(multiref);

        // Create a TypeMapping and register the specialized Type Mapping
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        tm.setSupportedEncodings(new String[] {Constants.URI_SOAP12_ENC});
        reg.register(Constants.URI_SOAP12_ENC, tm);

        QName dataQName = new QName("typeNS", "Data");
View Full Code Here

            RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[] { arg1 });
            msg.addBodyElement(body);
            body.setEncodingStyle(Constants.URI_LITERAL_ENC);

            SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
            msg.output(context);

            msgString = stringWriter.toString();
            assertTrue(msgString.indexOf("xmlns=\"\"")==-1);
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.axis.encoding.SerializationContextImpl

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.