Package org.apache.axis.encoding

Examples of org.apache.axis.encoding.DeserializationContext


       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        message.writeTo(baos);
       
        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        DeserializationContext dser = new DeserializationContext(
            new InputSource(bais), msgContext, org.apache.axis.Message.REQUEST);
        dser.parse();
       
        org.apache.axis.message.SOAPEnvelope env = dser.getEnvelope();
        RPCElement rpcElem = (RPCElement)env.getFirstBody();
        RPCParam output = rpcElem.getParam("testParam");
        assertNotNull("No <testParam> param", output);
       
        String result = (String)output.getObjectValue();
View Full Code Here


            Canonicalizer c14n = Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);
            byte[] canonicalMessage = c14n.canonicalizeSubtree(doc);

            InputSource is = new InputSource(new java.io.ByteArrayInputStream(canonicalMessage));
            DeserializationContext dser = null;
            if (msgContext == null) {
                AxisClient tmpEngine = new AxisClient(new NullProvider());
                msgContext = new MessageContext(tmpEngine);
            }
            dser = new DeserializationContext(is, msgContext,
                    Message.REQUEST, this);

            dser.parse();
            System.out.println("Client signing complete.");
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e.toString());
        }
View Full Code Here

                reader = new StringReader(msgString);
            } else {
                reader = new FileReader(args[0]);
            }
           
            DeserializationContext dser = new DeserializationContext(
                new InputSource(reader), msgContext, org.apache.axis.Message.REQUEST);
            dser.parse();
            SOAPEnvelope env = dser.getEnvelope();
           
            RPCElement rpcElem = (RPCElement)env.getFirstBody();
            RPCParam struct = rpcElem.getParam("struct");
            if (struct == null)
                throw new Exception("No <struct> param");
View Full Code Here

                is.setEncoding(encoding);
            }
        } else {
            is = new InputSource(new StringReader(getAsString()));
        }
        DeserializationContext dser = new DeserializationContext(is,
                                           getMessage().getMessageContext(),
                                           getMessage().getMessageType());
        dser.getEnvelope().setOwnerDocument(this);
        // This may throw a SAXException
        try {
            dser.parse();
        } catch (SAXException e) {
            Exception real = e.getException();
            if (real == null)
                real = e;
            throw AxisFault.makeFault(real);
        }

        SOAPEnvelope nse= dser.getEnvelope();
        if(currentMessageAsEnvelope != null){
          //Need to synchronize back processed header info.
          Vector newHeaders= nse.getHeaders();
          Vector oldHeaders= currentMessageAsEnvelope.getHeaders();
          if( null != newHeaders && null != oldHeaders){
View Full Code Here

        log.debug(msgString);
        log.debug("---");

        StringReader reader = new StringReader(msgString);

        DeserializationContext dser = new DeserializationContext(
            new InputSource(reader), msgContext, org.apache.axis.Message.REQUEST);
        dser.parse();

        SOAPEnvelope env = dser.getEnvelope();
        RPCElement rpcElem = (RPCElement)env.getFirstBody();
        RPCParam struct = rpcElem.getParam("struct");
        assertNotNull("No <struct> param", struct);

        Data val = (Data)struct.getObjectValue();
View Full Code Here

     * @throws Exception
     */
    public void testSAXXXE3() throws Exception
    {
        StringReader strReader3 = new StringReader(msg2);
        DeserializationContext dser = new DeserializationContext(
            new InputSource(strReader3), null, org.apache.axis.Message.REQUEST);
        dser.parse();
        SOAPEnvelope env = dser.getEnvelope();
        SOAPBodyElement body = (SOAPBodyElement)env.getBody().getChildElements().next();
        assertNotNull(body);
        MessageElement child = (MessageElement)body.getChildElements().next();
        assertNotNull(child);
        Iterator i = child.getAllAttributes();
View Full Code Here

     * @throws Exception
     */
    public void testNSStack() throws Exception
    {
        StringReader strReader3 = new StringReader(msg3);
        DeserializationContext dser = new DeserializationContext(
            new InputSource(strReader3), null, org.apache.axis.Message.REQUEST);
        dser.parse();
        org.apache.axis.message.SOAPEnvelope env = dser.getEnvelope();
        String xml = env.toString();
        assertXMLEqual(xml,msg3);
    }
View Full Code Here

    }

    private SOAPBodyElement getFirstBody(InputSource msgSource)
            throws Exception
    {
        DeserializationContext dser = new DeserializationContext(
                msgSource, _msgContext, Message.RESPONSE);
        dser.parse();
        SOAPEnvelope env = dser.getEnvelope();

        return env.getFirstBody();
    }
View Full Code Here

             */
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            resMsg.writeTo(out);
            ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());

            DeserializationContext dser =
                new DeserializationContext(new InputSource(in), resMsg.getMessageContext(), null);
            dser.parse();
            SOAPEnvelope responseEnvelope = dser.getEnvelope();

            SOAPBodyElement bodyEl = responseEnvelope.getFirstBody();
            if (bodyEl == null) {
                return null;
            }
View Full Code Here

        InputSource is = new InputSource(input);
        // FIX BUG http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18108
        //header = new SOAPHeader(this, soapConstants); // soapConstants = null!
        header = new SOAPHeader(this, Constants.DEFAULT_SOAP_VERSION); // soapConstants = null!
        // FIX BUG http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18108
        DeserializationContext dser = null ;
        AxisClient     tmpEngine = new AxisClient(new NullProvider());
        MessageContext msgContext = new MessageContext(tmpEngine);
        dser = new DeserializationContext(is, msgContext,
                                          Message.REQUEST, this );
        dser.parse();
    }
View Full Code Here

TOP

Related Classes of org.apache.axis.encoding.DeserializationContext

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.