Examples of JAXBBlockFactory


Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

            if (!marshalDesc.getAnnotationDesc(cls).hasXmlRootElement()) {
                object = new JAXBElement(wrapperQName, cls, object);
            }

            // Put the object into the message
            JAXBBlockFactory factory =
                    (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);

            Block block = factory.createFrom(object,
                                             new JAXBBlockContext(packages, packagesKey),
                                             wrapperQName);
            m.setBodyBlock(block);

            return m;
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

            if (!marshalDesc.getAnnotationDesc(cls).hasXmlRootElement()) {
                object = new JAXBElement(wrapperQName, cls, object);
            }

            // Put the object into the message
            JAXBBlockFactory factory =
                    (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);

            Block block = factory.createFrom(object,
                                             new JAXBBlockContext(packages, packagesKey),
                                             wrapperQName);
            m.setBodyBlock(block);

            return m;
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

        // Create the necessary JAXBContext
        JAXBContext jbc = JAXBContext.newInstance("test");
        JAXBBlockContext blockCtx = new JAXBBlockContext(jbc);
       
        // Create the Block
        JAXBBlockFactory blockFactory = (JAXBBlockFactory) FactoryRegistry.getFactory(JAXBBlockFactory.class);
        Block block = blockFactory.createFrom(echo, blockCtx, null);
       
        msg.setBodyBlock(block);
       
        MessageContext mc = new MessageContext();
        mc.setMEPContext(new MEPContext(mc));
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

        MessageFactory mf = (MessageFactory)
            FactoryRegistry.getFactory(MessageFactory.class);
        Message m = mf.create(Protocol.soap11);
       
        // Get the BlockFactory
        JAXBBlockFactory bf = (JAXBBlockFactory)
            FactoryRegistry.getFactory(JAXBBlockFactory.class);
       
        // Create the JAX-B object
        ObjectFactory of = new ObjectFactory();
        EchoStringResponse obj = of.createEchoStringResponse();
        obj.setEchoStringReturn("sample return value");
       
        // Create the JAXBContext
        JAXBBlockContext context = new JAXBBlockContext(EchoStringResponse.class.getPackage().getName());
       
        // Create a JAXBBlock using the Echo object as the content.  This simulates
        // what occurs on the outbound JAX-WS Dispatch<Object> client
        Block block = bf.createFrom(obj, context, null);
       
        // Add the block to the message as normal body content.
        m.setBodyBlock(block);
       
        // Check to see if the message is a fault.  The client/server will always call this method.
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

        MessageFactory mf = (MessageFactory)
            FactoryRegistry.getFactory(MessageFactory.class);
        Message m = mf.create(Protocol.soap11);
       
        // Get the BlockFactory
        JAXBBlockFactory bf = (JAXBBlockFactory)
            FactoryRegistry.getFactory(JAXBBlockFactory.class);
       
        // Create the JAX-B object
        ObjectFactory of = new ObjectFactory();
        EchoStringResponse obj = of.createEchoStringResponse();
        obj.setEchoStringReturn("sample return value");
       
        // Create the JAXBContext
        JAXBBlockContext context = new JAXBBlockContext(EchoStringResponse.class.getPackage().getName());
      
        // Create a JAXBBlock using the Echo object as the content.  This simulates
        // what occurs on the outbound JAX-WS Dispatch<Object> client
        Block block = bf.createFrom(obj, context, null);
       
        // Add the block to the message as normal body content.
        m.setBodyBlock(block);
       
        // Check to see if the message is a fault.  The client/server will always call this method.
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

            // Simulate saving the message so that it can be fully rebuilt.
            saveMsgText = m.getAsOMElement().toString();
        }
       
        // Get the BlockFactory
        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(EchoStringResponse.class.getPackage().getName());
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

        m.setStyle(Style.RPC);
        QName opQName = new QName("urn://sample", "op", "m");
        m.setOperationElement(opQName);
       
        // 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");
       
        // Create the JAX-B Element
        QName paramQName = new QName("urn://sample", "param", "m");
        JAXBElement e = new JAXBElement(paramQName, StockPrice.class, obj);
       
        // Create a JAXBBlock using the param object as the content.  This simulates
        // what occurs on the outbound JAX-WS Proxy client
        Block block = bf.createFrom(e, context, null);
       
        // Add the block to the message as normal body content.
        m.setBodyBlock(block);
       
        // Check to see if the message is a fault.  The client/server will always call this method.
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

        m.setStyle(Style.RPC);
        QName opQName = new QName("urn://sample", "op", "m");
        m.setOperationElement(opQName);
       
        // 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");
       
        // Create the JAX-B Element
        QName paramQName = new QName("urn://sample", "param", "m");
        JAXBElement e = new JAXBElement(paramQName, StockPrice.class, obj);
       
        // Create a JAXBBlock using the param object as the content.  This simulates
        // what occurs on the outbound JAX-WS Proxy client
        Block block = bf.createFrom(e, context, null);
       
        // Add the block to the message as normal body content.
        m.setBodyBlock(block);
       
        // Check to see if the message is a fault.  The client/server will always call this method.
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

       
        // Indicate that the message should be accessed as RPC
        m.setStyle(Style.RPC);
       
        // Get the BlockFactory
        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());
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory

   * normal Dispatch<JAXB> flow
   * @throws Exception
   */
  public void testJAXBOutflow() throws Exception {
    // Get the BlockFactory
    JAXBBlockFactory f = (JAXBBlockFactory)
      FactoryRegistry.getFactory(JAXBBlockFactory.class);
   
        // 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);
   
    // JAXB objects set the qname from their internal data
    assertTrue(block.isQNameAvailable());
   
    // Assume that we need to find the QName (perhaps to identify the operation and
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.