Package org.apache.axis.encoding

Examples of org.apache.axis.encoding.SerializationContextImpl


        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


        if ( currentForm == FORM_FAULT ) {
            StringWriter writer = new StringWriter();
            AxisFault env = (AxisFault)currentMessage;
            try {
                env.output(new SerializationContextImpl(writer, getMessage().getMessageContext()));
            } catch (Exception e) {
                log.error(JavaUtils.getMessage("exception00"), e);
                return null;
            }
            setCurrentMessage(writer.getBuffer().toString(), FORM_STRING);
            log.debug("Exit: SOAPPart::getAsString(): " + currentMessage);
            return (String)currentMessage;
        }

        if ( currentForm == FORM_SOAPENVELOPE ) {
            StringWriter writer = new StringWriter();
            SOAPEnvelope env = (SOAPEnvelope)currentMessage;
            try {
                env.output(new SerializationContextImpl(writer, getMessage().getMessageContext()));
            } catch (Exception e) {
                throw AxisFault.makeFault(e);
            }
            setCurrentMessage(writer.getBuffer().toString(), FORM_STRING);
            log.debug("Exit: SOAPPart::getAsString(): " + currentMessage);
View Full Code Here

       operationWrapper.appendChild(node);

       message.addBodyElement(new SOAPBodyElement(operationWrapper));
      
       StringWriter stringWriter = new StringWriter();
       SerializationContext context = new SerializationContextImpl(stringWriter, messageContext);
       context.setDoMultiRefs(false);
       message.output(context);
       stringWriter.close();
       String messageString = stringWriter.getBuffer().toString();
       logger.debug(messageString);
       Reader reader = new StringReader(messageString);
View Full Code Here

        TestBeanA tb1 = new TestBeanA();
        tb1.s1 = "john";
        TestBeanA tb2 = tb1;
       
        CharArrayWriter caw = new CharArrayWriter();
        SerializationContextImpl sci = new SerializationContextImpl(caw);
        sci.setDoMultiRefs(true);
        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanA.class);
        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanA.class);
       
        String s = caw.toString();
       
        // Cheap but fragile.
        int first = s.indexOf("#id0");
View Full Code Here

        TestBeanB tb1 = new TestBeanB();
        tb1.s1 = "john";
        TestBeanB tb2 = tb1;
       
        CharArrayWriter caw = new CharArrayWriter();
        SerializationContextImpl sci = new SerializationContextImpl(caw);
        sci.setDoMultiRefs(true);
        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanB.class);
        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanB.class);
       
        String s = caw.toString();
       
        // Cheap but fragile.
        int first = s.indexOf("#id0");
View Full Code Here

        tb1.s1 = "john";
        TestBeanA tb2 = new TestBeanA();
        tb2.s1 = "gregg";
       
        CharArrayWriter caw = new CharArrayWriter();
        SerializationContextImpl sci = new SerializationContextImpl(caw);
        sci.setDoMultiRefs(true);
        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanA.class);
        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanA.class);
       
        String s = caw.toString();
       
        // Cheap but fragile.
        int first = s.indexOf("#id0");
View Full Code Here

        tb1.s1 = "john";
        TestBeanA tb2 = new TestBeanA();
        tb2.s1 = "john";
       
        CharArrayWriter caw = new CharArrayWriter();
        SerializationContextImpl sci = new SerializationContextImpl(caw);
        sci.setDoMultiRefs(true);
        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanA.class);
        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanA.class);
       
        String s = caw.toString();
       
        // Cheap but fragile.
        int first = s.indexOf("#id0");
View Full Code Here

        tb1.s1 = "john";
        TestBeanB tb2 = new TestBeanB();
        tb2.s1 = "john";
       
        CharArrayWriter caw = new CharArrayWriter();
        SerializationContextImpl sci = new SerializationContextImpl(caw);
        sci.setDoMultiRefs(true);
        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanB.class);
        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanB.class);
       
        String s = caw.toString();
       
        // Cheap but fragile.
        int first = s.indexOf("#id0");
View Full Code Here

    }

    private Document getSOAPEnvelopeAsDocument(SOAPEnvelope env, MessageContext msgContext)
            throws Exception {
        StringWriter writer = new StringWriter();
        SerializationContext serializeContext = new SerializationContextImpl(writer, msgContext);
        env.output(serializeContext);
        writer.close();

        Reader reader = new StringReader(writer.getBuffer().toString());
        Document doc = XMLUtils.newDocument(new InputSource(reader));
View Full Code Here

    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

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.