Package org.apache.servicemix.client

Examples of org.apache.servicemix.client.DefaultServiceMixClient.sendSync()


    public void test() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("http://test", "MyProviderService"));
        me.getInMessage().setContent(new StringSource("<echo xmlns='http://test'><echoin0>world</echoin0></echo>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getFault() != null) {
                fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
            } else if (me.getError() != null) {
                throw me.getError();
View Full Code Here


    public void testSsl() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
        me.setService(new QName("http://test/ssl", "MyProviderService"));
        me.getInMessage().setContent(new StringSource("<echo xmlns='http://test'><echoin0>world</echoin0></echo>"));
        client.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getFault() != null) {
                fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
            } else if (me.getError() != null) {
                throw me.getError();
View Full Code Here

                             "             version=\"1.0\">"
                             "  <jbi:part>"
                             "    <msg:GetPerson><msg:personId>id</msg:personId></msg:GetPerson>"
                             "  </jbi:part>"
                             "</jbi:message>"));
        client.sendSync(me);

        System.err.println(new SourceTransformer().contentToString(me.getOutMessage()));
    }

    public void testSoap() throws Exception {
View Full Code Here

                             "             version=\"1.0\">"
                             "  <jbi:part>"
                             "    <msg:GetPerson><msg:personId>id</msg:personId></msg:GetPerson>"
                             "  </jbi:part>"
                             "</jbi:message>"));
        client.sendSync(me);
    }
   
    public void testSoapWithActionHeader() throws Exception {
        EchoComponent echo = new EchoComponent();
        echo.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "EchoService"));
View Full Code Here

                             "             version=\"1.0\">"
                             "  <jbi:part>"
                             "    <msg:GetPerson><msg:personId>id</msg:personId></msg:GetPerson>"
                             "  </jbi:part>"
                             "</jbi:message>"));
        client.sendSync(me);
    }


    public void testSendProblem() throws Exception {
        HttpComponent http = new HttpComponent();
View Full Code Here

                             "             version=\"1.0\">"
                             "  <jbi:part>"
                             "    <msg:GetPerson><msg:personId>id</msg:personId></msg:GetPerson>"
                             "  </jbi:part>"
                             "</jbi:message>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ERROR, me.getStatus());
    }
}
View Full Code Here

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
        me.setInterfaceName(new QName("http://jsr181.servicemix.apache.org", "ComplexPojoPortType"));
        me.getInMessage().setContent(new StringSource(
                "<oneWay xmlns='http://jsr181.servicemix.apache.org'><in0>world</in0></oneWay>"));
        client.sendSync(me);
       
        // Wait all acks being processed
        Thread.sleep(100);
    }
   
View Full Code Here

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
        me.setInterfaceName(new QName("http://jsr181.servicemix.apache.org", "ComplexPojoPortType"));
        me.getInMessage().setContent(new StringSource(
                "<twoWay xmlns='http://jsr181.servicemix.apache.org'><in0>world �</in0></twoWay>"));
        client.sendSync(me);
        log.info(new SourceTransformer().contentToString(me.getOutMessage()));
        client.done(me);
       
        // Wait all acks being processed
        Thread.sleep(100);
View Full Code Here

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
        me.setInterfaceName(new QName("http://jsr181.servicemix.apache.org", "ComplexPojoPortType"));
        me.getInMessage().setContent(new StringSource("<hel lo>world</hello"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getFault());
        Node n = transformer.toDOMNode(me.getFault());
        log.info(transformer.toString(n));
        assertNotNull(textValueOfXPath(n, "/stack"));
View Full Code Here

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut io = client.createInOutExchange();
        io.setService(new QName("urn:/HelloWorld2.wsdl", "HelloService"));
        io.setOperation(new QName("urn:/HelloWorld2.wsdl", "Hello"));
        io.getInMessage().setContent(new StreamSource(getClass().getResourceAsStream("/HelloWorldRequest.xml")));
        client.sendSync(io,20000);
        assertEquals(ExchangeStatus.ACTIVE,io.getStatus());
        assertNotNull(io.getOutMessage());
        assertNotNull(io.getOutMessage().getContent());

    }
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.