Examples of SerializationContext


Examples of org.apache.axis.encoding.SerializationContext

            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

Examples of org.apache.axis.encoding.SerializationContext

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

        Writer stringWriter = new StringWriter();
        SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
        context.setDoMultiRefs(false)// no multirefs
        context.setPretty(false);

        // Create a TypeMapping and register the Bean serializer/deserializer
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        // The "" namespace is literal (no encoding).
        tm.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
        reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
View Full Code Here

Examples of org.apache.axis.encoding.SerializationContext

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

        StringWriter writer = new StringWriter();
        SerializationContext context = new SerializationContextImpl(writer,
                                                                    msgContext);
        context.setDoMultiRefs(false);

        // Create a TypeMapping and register the Bean serializer/deserializer
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        // The "" namespace is literal (no encoding).
        tm.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
        reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
View Full Code Here

Examples of org.apache.axis.encoding.SerializationContext

        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

Examples of org.apache.axis.encoding.SerializationContext

                    JavaUtils.getMessage("noDoc00", elementString));
        return doc;
    }

    private String getAsString() throws Exception {
        SerializationContext serializeContext = null;
        StringWriter writer = new StringWriter();
        MessageContext msgContext;
        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

Examples of org.apache.axis.encoding.SerializationContext

         return null;
      }

      MessageContext       messageContext = ContainerConfig.getContext(  );
      StringWriter         writer  = new StringWriter(  );
      SerializationContext context = new SerializationContext( writer, messageContext );
      context.setPretty( true );
      for ( int i = 0; i < elements.length; i++ )
      {
         elements[i].output( context );
      }
View Full Code Here

Examples of org.apache.axis.encoding.SerializationContext

   public static void write( Writer         writer,
                             MessageElement element )
   throws Exception
   {
      MessageContext       messageContext = ContainerConfig.getContext(  );
      SerializationContext context = new SerializationContext( writer, messageContext );
      context.setPretty( true );
      element.output( context );
   }
View Full Code Here

Examples of org.apache.axis.encoding.SerializationContext

    }

    private String toXML( AxisFault axisFault, MessageContext msgContext ) throws Exception
    {
        Writer writer = new StringWriter();
        axisFault.output( new SerializationContext( writer, msgContext ) );
        String xml = writer.toString();
        writer.close();
        return xml;
    }
View Full Code Here

Examples of org.apache.axis2.databinding.SerializationContext

    }

    protected void serialize(OMOutputImpl omOutput, boolean cache)
            throws XMLStreamException {
        XMLStreamWriter writer = omOutput.getXmlStreamWriter();
        SerializationContext context = new SerializationContext(writer);

        // Write wrapper element
        if (ns == null) {
            writer.writeStartElement(localName);
        } else {
            writer.writeStartElement(localName, ns.getName(), ns.getPrefix());
        }
        Iterator outParams = method.getOutParams();
        while (outParams.hasNext()) {
            RPCParameter parameter = (RPCParameter) outParams.next();
            try {
                parameter.serialize(context);
            } catch (Exception e) {
                throw new XMLStreamException("Couldn't serialize RPCParameter",
                                             e);
            }
        }
        writer.writeEndElement();

        try {
            context.finish();
        } catch (Exception e) {
            throw new XMLStreamException(e);
        }
    }
View Full Code Here

Examples of org.auraframework.impl.context.AuraContextImpl.SerializationContext

        return AuraContext.class;
    }

    @Override
    public void write(Object value, Map<String, Object> attributes, Appendable out) throws IOException {
        JsonSerializationContext s = new SerializationContext();
        try {
            Json.serialize(value, out, s);
        } catch (AuraRuntimeException e) {
            AuraExceptionUtil.passQuickFix(e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.