Package org.apache.axis2.jaxws.message.factory

Examples of org.apache.axis2.jaxws.message.factory.JAXBBlockFactory.createFrom()


        // 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


        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

        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

        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

        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);
   
    // We did pass in a qname, so the following should return false
    assertTrue(block.isQNameAvailable());
   
    // Assume that we need to find the QName (perhaps to identify the operation and
View Full Code Here

        sw.flush();
    StringReader sr = new StringReader(sw.toString());
    XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);
   
    // Create a Block from the inflow. 
    Block block = f.createFrom(inflow, context, null);
   
    // Assuming no handlers are installed, the next thing that will happen
    // is the proxy code will ask for the business object.
    Object bo = block.getBusinessObject(true);
    assertTrue(bo instanceof EchoString);
View Full Code Here

        sw.flush();
    StringReader sr = new StringReader(sw.toString());
    XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);
   
    // Create a Block from the inflow. 
    Block block = f.createFrom(inflow, context, null);
       
    // Assume that we need to find the QName (perhaps to identify the operation and
    // determine if handlers are installed).   This is not very perfomant since
    // it causes an underlying parse of the String...but we need to support this.
    QName qName = block.getQName();
View Full Code Here

        sw.flush();
    StringReader sr = new StringReader(sw.toString());
    XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);
   
    // Create a Block from the inflow. 
    Block block = f.createFrom(inflow, context, expectedQName);
   
    // We passed in a qname, so the following should return false
    assertTrue(block.isQNameAvailable());
   
    // Assume that we need to find the QName (perhaps to identify the operation and
View Full Code Here

            // Put the object into the message
            JAXBBlockFactory factory =
                    (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
            JAXBBlockContext blockContext = new JAXBBlockContext(packages, packagesKey);
            blockContext.setWebServiceNamespace(ed.getTargetNamespace());
            Block block = factory.createFrom(object,
                                             blockContext,
                                             wrapperQName)// The factory will get the qname from the value
            m.setBodyBlock(block);

            //  Now place the headers in the message
View Full Code Here

            // Put the object into the message
            JAXBBlockFactory factory =
                    (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
            JAXBBlockContext blockContext = new JAXBBlockContext(packages, packagesKey);
            blockContext.setWebServiceNamespace(ed.getTargetNamespace());
            Block block = factory.createFrom(object,
                                             blockContext,
                                             wrapperQName)// The factory will get the qname from the value
            m.setBodyBlock(block);

            // Now place the headers in the message
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.