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

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


     * different Dispatch<OMElement> flow
     * @throws Exception
     */
    public void testOMOutflow2() throws Exception {
        // Get the BlockFactory
        OMBlockFactory f = (OMBlockFactory)
        FactoryRegistry.getFactory(OMBlockFactory.class);

        // Create a Block using the sample string as the content.  This simulates
        // what occurs on the outbound JAX-WS dispatch<OMElement> client
        StringReader sr = new StringReader(sampleText);
        XMLStreamReader inputReader = inputFactory.createXMLStreamReader(sr);
        StAXOMBuilder builder = new StAXOMBuilder(inputReader)
        OMElement om = builder.getDocumentElement();
        Block block = f.createFrom(om, null, 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


     *  Dispatch<OMElement> inflow
     * @throws Exception
     */
    public void testOMInflow() throws Exception {
        // Get the BlockFactory
        OMBlockFactory f = (OMBlockFactory)
        FactoryRegistry.getFactory(OMBlockFactory.class);

        // On inbound, there will already be a XMLStreamReader (probably from OM)
        // which represents the message.  We will simulate this with inflow.
        StringReader sr = new StringReader(sampleText);
        XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);

        // Create a Block from the inflow. 
        Block block = f.createFrom(inflow, null, null);

        // Let's assume we need to get the QName to find the operation name.
        // This will cause an underlying parse
        QName qName = block.getQName();
        assertTrue(sampleQName.equals(qName));
View Full Code Here

        try {
            Block[] blocks = null;
            SOAPFaultDetail detail = soapFault.getDetail();
            if (detail != null) {
                // Create a block for each element
                OMBlockFactory bf =
                        (OMBlockFactory)FactoryRegistry.getFactory(OMBlockFactory.class);
                ArrayList<Block> list = new ArrayList<Block>();
                Iterator it = detail.getChildElements();
                while (it.hasNext()) {
                    OMElement om = (OMElement)it.next();
                    Block b = bf.createFrom(om, null, om.getQName());
                    list.add(b);
                }
                blocks = new Block[list.size()];
                blocks = list.toArray(blocks);
            }
View Full Code Here

                SAAJConverterFactory converterFactory = (SAAJConverterFactory)FactoryRegistry
                        .getFactory(SAAJConverterFactory.class);
                SAAJConverter converter = converterFactory.getSAAJConverter();

                // Create a block for each element
                OMBlockFactory bf =
                        (OMBlockFactory)FactoryRegistry.getFactory(OMBlockFactory.class);
                ArrayList<Block> list = new ArrayList<Block>();
                Iterator it = detail.getChildElements();
                while (it.hasNext()) {
                    DetailEntry de = (DetailEntry)it.next();
                    OMElement om = converter.toOM(de);
                    Block b = bf.createFrom(om, null, om.getQName());
                    list.add(b);
                }
                blocks = new Block[list.size()];
                blocks = list.toArray(blocks);
            }
View Full Code Here

   * normal Dispatch<OMElement> flow
   * @throws Exception
   */
  public void testOMOutflow() throws Exception {
    // Get the BlockFactory
    OMBlockFactory f = (OMBlockFactory)
      FactoryRegistry.getFactory(OMBlockFactory.class);
   
    // Create a Block using the sample string as the content.  This simulates
    // what occurs on the outbound JAX-WS dispatch<OMElement> client
    StringReader sr = new StringReader(sampleText);
    XMLStreamReader inputReader = inputFactory.createXMLStreamReader(sr);
    StAXOMBuilder builder = new StAXOMBuilder(inputReader)
    OMElement om = builder.getDocumentElement();
    Block block = f.createFrom(om, null, null);
   
    // Assuming no handlers are installed, the next thing that will happen
    // is a XMLStreamReader will be requested...to go to OM.   At this point the
    // block should be consumed.
    XMLStreamReader reader = block.getXMLStreamReader(true);
View Full Code Here

   * different Dispatch<OMElement> flow
   * @throws Exception
   */
  public void testOMOutflow2() throws Exception {
    // Get the BlockFactory
    OMBlockFactory f = (OMBlockFactory)
      FactoryRegistry.getFactory(OMBlockFactory.class);
   
    // Create a Block using the sample string as the content.  This simulates
    // what occurs on the outbound JAX-WS dispatch<OMElement> client
    StringReader sr = new StringReader(sampleText);
    XMLStreamReader inputReader = inputFactory.createXMLStreamReader(sr);
    StAXOMBuilder builder = new StAXOMBuilder(inputReader)
    OMElement om = builder.getDocumentElement();
    Block block = f.createFrom(om, null, 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

   *  Dispatch<OMElement> inflow
   * @throws Exception
   */
  public void testOMInflow() throws Exception {
    // Get the BlockFactory
    OMBlockFactory f = (OMBlockFactory)
      FactoryRegistry.getFactory(OMBlockFactory.class);
   
    // On inbound, there will already be a XMLStreamReader (probably from OM)
    // which represents the message.  We will simulate this with inflow.
    StringReader sr = new StringReader(sampleText);
    XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);
   
    // Create a Block from the inflow. 
    Block block = f.createFrom(inflow, null, null);
   
    // Let's assume we need to get the QName to find the operation name.
    // This will cause an underlying parse
    QName qName = block.getQName();
    assertTrue(sampleQName.equals(qName));
View Full Code Here

            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here

            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.message.factory.OMBlockFactory

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.