Package org.apache.cxf.aegis

Examples of org.apache.cxf.aegis.AegisContext


     */
    public void initialize(Service s) {

        // We want to support some compatibility configuration properties.
        if (aegisContext == null) {
            aegisContext = new AegisContext();

            Object val = s.get(READ_XSI_TYPE_KEY);
            if ("false".equals(val) || Boolean.FALSE.equals(val)) {
                aegisContext.setReadXsiTypes(false);
            }
View Full Code Here


       
        if (type == null) {
            type = messyCastToRawType(genericType);
        }

        AegisContext context = getAegisContext(type, genericType);
        AegisType typeToRead = context.getTypeMapping().getType(genericType);
       
        AegisReader<XMLStreamReader> aegisReader = context.createXMLStreamReader();
        try {
            XMLStreamReader xmlStreamReader = createStreamReader(typeToRead, is);
            return type.cast(aegisReader.read(xmlStreamReader, typeToRead));
        } catch (Exception e) {
            throw new WebApplicationException(e);
View Full Code Here

            type = obj.getClass();
        }
        if (genericType == null) {
            genericType = type;
        }
        AegisContext context = getAegisContext(type, genericType);
        AegisType aegisType = context.getTypeMapping().getType(genericType);
        AegisWriter<XMLStreamWriter> aegisWriter = context.createXMLStreamWriter();
        try {
            XMLStreamWriter xmlStreamWriter = createStreamWriter(aegisType.getSchemaType(), os);
            // use type qname as element qname?
            xmlStreamWriter.writeStartDocument();
            aegisWriter.write(obj, aegisType.getSchemaType(), false, xmlStreamWriter, aegisType);
View Full Code Here

        addNamespace("b", "urn:Bean");
        addNamespace("a", "urn:anotherns");
        addNamespace("xsi", SOAPConstants.XSI_NS);
        addNamespace("soapenc", Soap11.getInstance().getSoapEncodingStyle());

        AegisContext context = new AegisContext();
        // create a different mapping than the context creates.
        TypeMapping baseMapping = DefaultTypeMapping.createSoap11TypeMapping(true, false, false);
        mapping = new DefaultTypeMapping(SOAPConstants.XSD, baseMapping);
        mapping.setTypeCreator(context.createTypeCreator());
        context.setTypeMapping(mapping);
        context.initialize();
        // serialization root type
        trailingBlocks = new TrailingBlocks();
    }
View Full Code Here

        // serialization root type
        trailingBlocks = new TrailingBlocks();
    }
   
    protected Context getContext() {
        AegisContext globalContext = new AegisContext();
        globalContext.initialize();
        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }
View Full Code Here

        ServerFactoryBean sf = createServiceFactory(InheritanceService.class,
                                                    null, "InheritanceService",
                                                    new QName("urn:xfire:inheritance",
                                                              "InheritanceService"),
                                                    null);
        AegisContext globalContext = new AegisContext();
        globalContext.setWriteXsiTypes(true);

        Set<String> l = new HashSet<String>();
        l.add(Employee.class.getName());
        globalContext.setRootClassNames(l);
        AegisDatabinding binding = new AegisDatabinding();
        binding.setAegisContext(globalContext);

        sf.getServiceFactory().setDataBinding(binding);
        sf.create();
View Full Code Here

public class StructTypeTest extends AbstractEncodedTest {
    private StructType addressType;
    private StructType purchaseOrderType;
   
    private Context getLocalContext() {
        AegisContext aegisContext = new AegisContext();
        return new Context(aegisContext);
    }
View Full Code Here

        addNamespace("b", "urn:Bean");
        addNamespace("a", "urn:anotherns");
        addNamespace("xsi", SOAPConstants.XSI_NS);
        addNamespace("soapenc", Soap11.getInstance().getSoapEncodingStyle());

        AegisContext context = new AegisContext();
        // create a different mapping than the context creates.
        TypeMapping baseMapping = DefaultTypeMapping.createSoap11TypeMapping(true, false, false);
        mapping = new DefaultTypeMapping(SOAPConstants.XSD, baseMapping);
        mapping.setTypeCreator(context.createTypeCreator());
        context.setTypeMapping(mapping);
        context.initialize();
        // serialization root type
        trailingBlocks = new TrailingBlocks();
    }
View Full Code Here

        // serialization root type
        trailingBlocks = new TrailingBlocks();
    }
   
    protected Context getContext() {
        AegisContext globalContext = new AegisContext();
        globalContext.initialize();
        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }
View Full Code Here

        addNamespace("xsi", SOAPConstants.XSI_NS);
    }
   
    @Test
    public void testAnnotatedDefaultUnqualifiedAttribute() throws Exception {
        AegisContext context = new AegisContext();
        context.initialize();
        TypeMapping mapping = context.getTypeMapping();
       
        Type type = mapping.getTypeCreator().createType(AttributeBean.class);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        Context messageContext = new Context(context);
View Full Code Here

TOP

Related Classes of org.apache.cxf.aegis.AegisContext

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.