Package org.objectweb.celtix.context

Examples of org.objectweb.celtix.context.GenericMessageContext


        throws IOException, SQLException, SOAPException  {
        IMocksControl control = EasyMock.createNiceControl();
        RMMessage msg = control.createMock(RMMessage.class);
        EasyMock.expect(msg.getMessageNr()).andReturn(mn);
             
        MessageContext ctx = new GenericMessageContext();
        ctx.put("a", "astring");
        ctx.put("b", Boolean.TRUE);
        ctx.put("c", new Integer(Integer.MIN_VALUE));
        ctx.put("d", mn);
        ctx.put("e", this);
        InputStream mis = RMHandlerTest.class.getResourceAsStream("resources/GreetMeDocLiteralRequest.xml");
        SOAPBindingImpl binding = new SOAPBindingImpl(false);
        SOAPMessage smsg = binding.getMessageFactory().createMessage(null, mis);
        ctx.put(SOAP_MSG_KEY, smsg);
        InputStream cis = RMUtils.getPersistenceUtils().getContextAsInputStream(ctx);
        EasyMock.expect(msg.getContextAsStream()).andReturn(cis);
       
        control.replay();
        store.beginTransaction();
View Full Code Here


    protected void setUp() throws Exception {
        super.setUp();

        binding = new SOAPBindingImpl(false);
        objContext = new ObjectMessageContextImpl();
        soapContext = new SOAPMessageContextImpl(new GenericMessageContext());
       
        Method greetMe = SOAPMessageUtil.getMethod(GreeterRPCLit.class, "greetMe");
        objContext.setMethod(greetMe);
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
       
        binding = new SOAPBindingImpl(false);
        objContext = new ObjectMessageContextImpl();
        soapContext = new SOAPMessageContextImpl(new GenericMessageContext());
       
        objContext.setMethod(SOAPMessageUtil.getMethod(Greeter.class, "greetMe"));
    }
View Full Code Here

       
        factory = MessageFactory.newInstance();
    }
   
    public void testGetHeaders() throws Exception {
        SOAPMessageContext smc = new SOAPMessageContextImpl(new GenericMessageContext());
        assertNotNull(smc);

        JAXBContext jaxbContext = JAXBContext.newInstance(TestHeader1.class.getPackage().getName());
        //Test 1 No Headers in SOAP Message
        setSOAPMessage(smc, "resources/TestIntDocLitTypeTestReq.xml");
View Full Code Here

                                                               DataBindingCallback.Mode.PARTS, null));       
    }

    public void testhasFault() throws Exception {
        TestClientBinding clientBinding = new TestClientBinding(bus, epr);
        SOAPMessageContext soapCtx = new SOAPMessageContextImpl(new GenericMessageContext());

        InputStream is =  getClass().getResourceAsStream("resources/NoSuchCodeDocLiteral.xml");
        MessageFactory msgFactory = MessageFactory.newInstance();
        SOAPMessage faultMsg = msgFactory.createMessage(null,  is);
        soapCtx.setMessage(faultMsg);
View Full Code Here

        TestClientBinding clientBinding = new TestClientBinding(bus, epr);
        InputStream is =  getClass().getResourceAsStream("resources/GreetMeDocLiteralResp.xml");
        TestInputStreamContext tisc = new TestInputStreamContext(null);
        tisc.setInputStream(is);
       
        SOAPMessageContext soapCtx = new SOAPMessageContextImpl(new GenericMessageContext());       
        clientBinding.getBindingImpl().read(tisc,  soapCtx);
        assertNotNull(soapCtx.getMessage());
    }
View Full Code Here

        BufferedReader br =
            new BufferedReader(
                new InputStreamReader(
                    getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml")));
       
        SOAPMessageContext soapCtx = new SOAPMessageContextImpl(new GenericMessageContext());
        soapCtx.setMessage(greetMeMsg);
       
        TestOutputStreamContext tosc = new TestOutputStreamContext(null, soapCtx);
        clientBinding.getBindingImpl().write(soapCtx, tosc);
View Full Code Here

        }
        return new ByteArrayInputStream(bos.toByteArray());
    }
   
    public MessageContext getContext(InputStream is) {
        MessageContext ctx = new GenericMessageContext();
        try {
            ObjectInput oi = new ObjectInputStream(is);
            int nKeys = oi.readInt();
           
            for (int i = 0; i < nKeys; i++) {
                String key = (String)oi.readObject();
                Object value = oi.readObject();
                ctx.put(key, value);
            }
           
            // construct SOAPMessage from input stream
           
            SOAPMessage msg = getMessageFactory().createMessage(null, is);
            ctx.put(SOAP_MSG_KEY, msg);
           
        } catch (Exception ex) {
            throw new RMStoreException(ex)
        }
        return ctx;
View Full Code Here

    private GenericMessageContext wrapped;
    private MessageContextWrapper wrapper;
   
    @Override
    protected MessageContext getMessageContext() {
        wrapped = new GenericMessageContext();
        wrapper = new MessageContextWrapper(wrapped);
        return wrapper;
    }
View Full Code Here

    }


    public void testConstructor() {

        GenericMessageContext gmc = new GenericMessageContext();
        WebServiceContextImpl ctx = new WebServiceContextImpl(gmc);
        assertSame(gmc, ctx.getMessageContext());
    }
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.context.GenericMessageContext

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.