Package org.apache.axis

Examples of org.apache.axis.MessageContext


        // If there was no exception, we succeeded in serializing it.
    }

    public void testEmptyXMLNS() throws Exception
    {
        MessageContext msgContext = new MessageContext(new AxisServer());
        String req =
                "<xsd1:A xmlns:xsd1=\"urn:myNamespace\">"
                + "<xsd1:B>"
                + "<xsd1:C>foo bar</xsd1:C>"
                + "</xsd1:B>"
View Full Code Here


     *
     * @throws Exception
     */
    public void testDefaultNamespace() throws Exception
    {
        MessageContext msgContext = new MessageContext(new AxisServer());
        String req =
                "<xsd1:A xmlns:xsd1=\"urn:myNamespace\">"
                + "<B>"  // Note that B and C are in no namespace!
                + "<C>foo bar</C>"
                + "</B>"
View Full Code Here

        output.set_any(inputAny.get_any());
        return output;
    }

    public void echoVoidSoapHeader() throws java.rmi.RemoteException {
        MessageContext context = MessageContext.getCurrentContext();
        Message request = context.getRequestMessage();
        Message response = context.getResponseMessage();
        Vector headers = request.getSOAPEnvelope().getHeaders();
        for (int i=0;i<headers.size();i++) {
            SOAPHeaderElement header = (SOAPHeaderElement)headers.get(i);
            response.getSOAPEnvelope().addHeader(header);
        }
View Full Code Here

        String  hName = null ;
        Handler h     = null ;

        // save previous context
        MessageContext previousContext = getCurrentMessageContext();

        try {
            // set active context
            setCurrentMessageContext(msgContext);
View Full Code Here

     */
    protected void roundtrip(String data)
       throws Exception
    {
       Message message = new Message(header + data + footer);
       message.setMessageContext(new MessageContext(server));

       message.getSOAPEnvelope();

       assertEquals(header+data+footer, message.getSOAPPartAsString());
    }
View Full Code Here

     */
    protected void deserialize(String data, Object expected)
       throws Exception
    {
       Message message = new Message(header + data + footer);
       message.setMessageContext(new MessageContext(server));

       SOAPEnvelope envelope = (SOAPEnvelope)message.getAsSOAPEnvelope();
       assertNotNull("envelope", envelope);

       RPCElement body = (RPCElement)envelope.getFirstBody();
View Full Code Here

               msgString += data;
           msgString += messageParts[i];
       }
      
       Message message = new Message(msgString);
       message.setMessageContext(new MessageContext(new AxisServer()));

       SOAPEnvelope envelope = (SOAPEnvelope)message.getAsSOAPEnvelope();
       assertNotNull("envelope", envelope);

       RPCElement body = (RPCElement)envelope.getFirstBody();
View Full Code Here

    }

    public void testNoXsiTypes()
       throws Exception
    {
        MessageContext msgContext = new MessageContext(new AxisServer());
        ServiceDescription sd = new ServiceDescription("testXsiType", true);

        // Don't serialize xsi:type attributes
        sd.setSendTypeAttr(false);

        msgContext.setServiceDescription(sd);

        SOAPEnvelope msg = new SOAPEnvelope();
        RPCParam arg1 = new RPCParam("urn:myNamespace",
                                     "testParam",
                                     "this is a string");
View Full Code Here

    public TestString(String name) {
        super(name);
    }

    private void runtest(String value, String expected) throws Exception {
        MessageContext msgContext = new MessageContext(new AxisServer());
        SOAPEnvelope msg = new SOAPEnvelope();
        RPCParam input = new RPCParam("urn:myNamespace", "testParam", value);
       
        RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ input });
        msg.addBodyElement(body);
View Full Code Here

        return (MessageElement)obj;
    }
   
    public Element getAsDOM() throws Exception
    {
        MessageContext msgContext = context.getMessageContext();
       
        StringWriter writer = new StringWriter();
        output(new SerializationContext(writer, msgContext));
        writer.close();
       
View Full Code Here

TOP

Related Classes of org.apache.axis.MessageContext

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.