Examples of DeserializationContext


Examples of org.apache.axis.encoding.DeserializationContext

        log.debug(msgString);
        log.debug("---");
       
        StringReader reader = new StringReader(msgString);
       
        DeserializationContext dser = new DeserializationContextImpl(
            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.getValue();
View Full Code Here

Examples of org.apache.axis.encoding.DeserializationContext

        if ( currentForm == FORM_INPUTSTREAM ) {
            is = new InputSource( (InputStream) currentMessage );
        } else {
            is = new InputSource(new StringReader(getAsString()));
        }
        DeserializationContext dser = new DeserializationContextImpl(is,
                                           getMessage().getMessageContext(),
                                           getMessage().getMessageType());

        // This may throw a SAXException
        try {
            dser.parse();
        } catch (SAXException e) {
            Exception real = e.getException();
            if (real == null)
                real = e;
            throw AxisFault.makeFault(real);
        }

        setCurrentMessage(dser.getEnvelope(), FORM_SOAPENVELOPE);
       
        log.debug("Exit: SOAPPart::getAsSOAPEnvelope");
        return (SOAPEnvelope)currentMessage;
    }
View Full Code Here

Examples of org.apache.axis.encoding.DeserializationContext

       stringWriter.close();
       String messageString = stringWriter.getBuffer().toString();
       logger.debug(messageString);
       Reader reader = new StringReader(messageString);
       messageContext.setProperty(BeanDeserializer.DESERIALIZE_ANY, Boolean.TRUE);
       DeserializationContext deserializer = new DeserializationContextImpl(new InputSource(reader),
                                                                           messageContext,
                                                                           Message.REQUEST);
       deserializer.parse();
       SOAPEnvelope env = deserializer.getEnvelope();
      
       RPCElement rpcElem = (RPCElement)env.getFirstBody();
       Vector parameters = rpcElem.getParams();
       RPCParam param = (RPCParam) parameters.get(0);
       return param.getValue();
View Full Code Here

Examples of org.apache.axis.encoding.DeserializationContext

                is.setEncoding(encoding);
            }
        } else {
            is = new InputSource(new StringReader(getAsString()));
        }
        DeserializationContext dser = new DeserializationContextImpl(is,
                                           getMessage().getMessageContext(),
                                           getMessage().getMessageType());

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

Examples of org.apache.axis.encoding.DeserializationContext

                char chars[] = ((String)(events.get(n,1))).toCharArray();
                lexicalHandler.comment(chars, 0, chars.length);            
           
            } else if (event == STATE_NEWELEMENT) {
                if (handler instanceof DeserializationContext) {
                    DeserializationContext context =
                              (DeserializationContext)handler;
                    context.setCurElement(
                              (MessageElement)(events.get(n,1)));
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.axis.encoding.DeserializationContext

    }

    public void testAddChild() throws Exception {
        SOAPConstants sc = SOAPConstants.SOAP11_CONSTANTS;
        EnvelopeBuilder eb = new EnvelopeBuilder(Message.REQUEST, sc);
        DeserializationContext dc = new DeserializationContextImpl(null,
                                                                   eb);
        MessageElement parent = new MessageElement("parent.names",
                                                "parent",
                                                "parns",
                                                null,
View Full Code Here

Examples of org.apache.axis.encoding.DeserializationContext

        assertTrue("Unexpected child", !c1only.hasNext());
    }
    public void testDetachNode() throws Exception {
        SOAPConstants sc = SOAPConstants.SOAP11_CONSTANTS;
        EnvelopeBuilder eb = new EnvelopeBuilder(Message.REQUEST, sc);
        DeserializationContext dc = new DeserializationContextImpl(null,
                                                                   eb);
        SOAPElement parent = new MessageElement("parent.names",
                                                "parent",
                                                "parns",
                                                null,
View Full Code Here

Examples of org.apache.axis.encoding.DeserializationContext

    public void testMessageElementNullOngetNamespaceURI() throws Exception{
        String data="<anElement xmlns:ns1=\"aNamespace\" href=\"unknownProtocol://data\"/>";
        data="<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP-ENV:Body>"+
             data+"</SOAP-ENV:Body></SOAP-ENV:Envelope>";
        MessageContext ctx=new MessageContext(new AxisClient());
        DeserializationContext dser = new DeserializationContextImpl(
                                           new org.xml.sax.InputSource(new StringReader(data)),
                                           ctx,
                                           Message.REQUEST);
        dser.parse();
    MessageElement elem=dser.getEnvelope().getBodyByName("","anElement");
        assertEquals("aNamespace",elem.getNamespaceURI("ns1"));
        assertEquals("ns1",elem.getPrefix("aNamespace"));
    }   
View Full Code Here

Examples of org.apache.axis.encoding.DeserializationContext

            SOAPBodyElement aBodyElement = body.addBodyElement(aName);
            SOAPElement bElement = aBodyElement.addChildElement(AA_TAG, A_PREFIX);
            String data = envelope.toString();

            MessageContext ctx = new MessageContext(new AxisClient());
            DeserializationContext dser = new DeserializationContextImpl(
                    new org.xml.sax.InputSource(new StringReader(data)),
                    ctx,
                    Message.REQUEST);
            dser.parse();
            MessageElement elem = dser.getEnvelope().getBodyByName(A_NAMESPACE_URI, A_TAG);
            Iterator iterator = elem.getChildElements();
            while(iterator.hasNext()){
                MessageElement elem2 = (MessageElement)iterator.next();
                Name name = elem2.getElementName();
                assertEquals(A_NAMESPACE_URI, name.getURI());
View Full Code Here

Examples of org.apache.axis.encoding.DeserializationContext

        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 DeserializationContextImpl(is, msgContext,
                                              Message.REQUEST, this );
        dser.parse();
    }
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.