Package org.apache.axis2.jaxws.message.databinding

Examples of org.apache.axis2.jaxws.message.databinding.JAXBBlockContext


        // Get the BlockFactory
        JAXBBlockFactory bf = (JAXBBlockFactory)
            FactoryRegistry.getFactory(JAXBBlockFactory.class);
       
        // Create the JAXBContext
        JAXBBlockContext context = new JAXBBlockContext(StockPrice.class.getPackage().getName());
       
        // Create the JAX-B object
        ObjectFactory of = new ObjectFactory();
        StockPrice obj = of.createStockPrice();
        obj.setPrice("100");
View Full Code Here


        // Get the BlockFactory
        JAXBBlockFactory bf = (JAXBBlockFactory)
            FactoryRegistry.getFactory(JAXBBlockFactory.class);
       
        // Create the JAXBContext
        JAXBBlockContext context = new JAXBBlockContext(StockPrice.class.getPackage().getName());
       
        // Create the JAX-B object
        ObjectFactory of = new ObjectFactory();
        StockPrice obj = of.createStockPrice();
        obj.setPrice("100");
View Full Code Here

        JAXBBlockFactory bf = (JAXBBlockFactory)
            FactoryRegistry.getFactory(JAXBBlockFactory.class);
       
        // Create the JAXBContext instance that will be used
        // to deserialize the JAX-B object content in the message.
        JAXBBlockContext context = new JAXBBlockContext(StockPrice.class.getPackage().getName());
       
        // Get the JAXBBlock that wraps the content
        Block b = m.getBodyBlock(context, bf);
    
        // Check to see if the message is a fault.  The client/server will always call this method.
View Full Code Here

   
        // Create a jaxb object
        ObjectFactory factory = new ObjectFactory();
        EchoString jaxb = factory.createEchoString();
        jaxb.setInput("Hello World");
        JAXBBlockContext context = new JAXBBlockContext(EchoString.class.getPackage().getName());
      
        JAXBIntrospector jbi = JAXBUtils.getJAXBIntrospector(context.getJAXBContext());
        QName expectedQName = jbi.getElementName(jaxb);
       
    // Create a Block using the sample string as the content.  This simulates
    // what occurs on the outbound JAX-WS dispatch<JAXB> client
    Block block = f.createFrom(jaxb, context, null);
View Full Code Here

   
        // Create a jaxb object
        ObjectFactory factory = new ObjectFactory();
        EchoString jaxb = factory.createEchoString();
        jaxb.setInput("Hello World");
        JAXBBlockContext context = new JAXBBlockContext(EchoString.class.getPackage().getName());
       
        JAXBIntrospector jbi = JAXBUtils.getJAXBIntrospector(context.getJAXBContext());
        QName expectedQName = jbi.getElementName(jaxb);
       
    // Create a Block using the sample string as the content.  This simulates
    // what occurs with an outbound JAX-WS JAXB parameter
    Block block = f.createFrom(jaxb, context, expectedQName);
View Full Code Here

   
        // Create a jaxb object
        ObjectFactory factory = new ObjectFactory();
        EchoString jaxb = factory.createEchoString();
        jaxb.setInput("Hello World");
        JAXBBlockContext context = new JAXBBlockContext(EchoString.class.getPackage().getName());
   
    // On inbound, there will already be a XMLStreamReader (probably from OM)
    // which represents the message.  We will simulate this with inflow.
        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        Marshaller marshaller = JAXBUtils.getJAXBMarshaller(context.getJAXBContext());
        marshaller.marshal(jaxb, writer);
        JAXBUtils.releaseJAXBMarshaller(context.getJAXBContext(), marshaller);
        writer.flush();
        sw.flush();
    StringReader sr = new StringReader(sw.toString());
    XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);
   
View Full Code Here

   
        // Create a jaxb object
        ObjectFactory factory = new ObjectFactory();
        EchoString jaxb = factory.createEchoString();
        jaxb.setInput("Hello World");
        JAXBBlockContext context = new JAXBBlockContext(EchoString.class.getPackage().getName());

        JAXBIntrospector jbi = JAXBUtils.getJAXBIntrospector(context.getJAXBContext());
        QName expectedQName = jbi.getElementName(jaxb);
   
    // On inbound, there will already be a XMLStreamReader (probably from OM)
    // which represents the message.  We will simulate this with inflow.
        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        Marshaller marshaller = JAXBUtils.getJAXBMarshaller(context.getJAXBContext());
        marshaller.marshal(jaxb, writer);
        JAXBUtils.releaseJAXBMarshaller(context.getJAXBContext(), marshaller);
        writer.flush();
        sw.flush();
    StringReader sr = new StringReader(sw.toString());
    XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);
   
View Full Code Here

   
        // Create a jaxb object
        ObjectFactory factory = new ObjectFactory();
        EchoString jaxb = factory.createEchoString();
        jaxb.setInput("Hello World");
        JAXBBlockContext context = new JAXBBlockContext(EchoString.class.getPackage().getName());
       
        JAXBIntrospector jbi = JAXBUtils.getJAXBIntrospector(context.getJAXBContext());
        QName expectedQName = jbi.getElementName(jaxb);
   
    // On inbound, there will already be a XMLStreamReader (probably from OM)
    // which represents the message.  We will simulate this with inflow.
        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        Marshaller marshaller = JAXBUtils.getJAXBMarshaller(context.getJAXBContext());
        marshaller.marshal(jaxb, writer);
        JAXBUtils.releaseJAXBMarshaller(context.getJAXBContext(), marshaller);
        writer.flush();
        sw.flush();
    StringReader sr = new StringReader(sw.toString());
    XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);
   
View Full Code Here

                //if (isAsyncHandler(param)) {
                //    continue;
                //}

                Block block = null;
                JAXBBlockContext context = new JAXBBlockContext(packages);

                AttachmentDescription attachmentDesc = pd.getAttachmentDescription();
                if (attachmentDesc == null) {
                   
                    // Normal Processing: Not an Attachment
                    // Trigger unmarshal by java type if necessary
                    if (unmarshalByJavaType != null && unmarshalByJavaType[i] != null) {
                        context.setProcessType(unmarshalByJavaType[i]);
                        context.setIsxmlList(pd.isListType());
                    }
                   
                    // Unmarshal the object into a JAXB object or JAXBElement
                    if (pd.isHeader()) {
                       
View Full Code Here

        int index = message.getNumBodyBlocks();
        for (int i = 0; i < pdeList.size(); i++) {
            PDElement pde = pdeList.get(i);

            // Create JAXBContext
            JAXBBlockContext context = new JAXBBlockContext(packages);

            Attachment attachment = pde.getAttachment();
            if (attachment == null) {
                // Normal Flow: Not an attachment
               
               
                // Marshal by type only if necessary
                if (pde.getByJavaTypeClass() != null) {
                    context.setProcessType(pde.getByJavaTypeClass());
                    if(pde.getParam()!=null){
                        context.setIsxmlList(pde.getParam().isListType());
                    }
                }
                // Create a JAXBBlock out of the value.
                // (Note that the PDElement.getValue always returns an object
                // that has an element rendering...ie. it is either a JAXBElement o
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.message.databinding.JAXBBlockContext

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.