Package org.codehaus.xfire.client

Examples of org.codehaus.xfire.client.Client.invoke()


{
    public void SKIPtestCurrencyConverter() throws MalformedURLException, Exception
    {
        Client client = new Client(new URL("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL"));
       
        Object[] results = client.invoke("ConversionRate", new Object[] {"BRL", "UGX"});
       
        // Service returns a double of the currency conversion rate.
        System.out.println((Double) results[0]);
    }
   
View Full Code Here


   
    public void SKIPtestWeatherForecast() throws MalformedURLException, Exception
    {
        Client client = new Client(new URL("http://www.webservicex.net/WeatherForecast.asmx?WSDL"));
       
        Object[] results = client.invoke("GetWeatherByZipCode", new Object[] {"49506"});
       
        // The response is a complex type which we don't know how to represent.
        // So XFire converts it into a org.w3c.dom.Document. You can then navigate
        // the document and find the desired information.
        DOMUtils.writeXml((Document) results[0], System.out);
View Full Code Here

        client.setXFire(getXFire());
        client.setUrl("xfire.local://AuthService");
        client.setTransport(getTransportManager().getTransport(LocalTransport.BINDING_ID));
       
        try {
            Object[] response = client.invoke("authenticate", new Object[] {"yo", "yo"});
            fail("Should have thrown response. Received: " + response);
        }
        catch (XFireFault fault) {
            assertEquals("message", fault.getReason());
        }
View Full Code Here

        JMSChannel serverChannel = (JMSChannel) getTransport().createChannel("jms://Echo");
        Client client = new Client(getTransport(), service, "jms://Echo", "jms://Peer1");

        OperationInfo op = service.getServiceInfo().getOperation("echo");
        Object[] response = client.invoke(op, new Object[] {"hello"});

        assertNotNull(response);
        assertEquals(1, response.length);
       
        String resString = (String) response[0];
View Full Code Here

        Service serviceModel = sf.create(Echo.class);
        Client client = new Client(clientTrans, serviceModel, id + "/Echo");
        client.setTimeout(10000);
    
        OperationInfo op = serviceModel.getServiceInfo().getOperation("echo");
        Object[] response = client.invoke(op, new Object[] {"hello"});

        assertNotNull(response);
        assertEquals(1, response.length);
       
        String resString = (String) response[0];
View Full Code Here

        client.addInHandler(new AddressingInHandler());
        client.addOutHandler(new AddressingOutHandler());
        client.addFaultHandler(new AddressingInHandler());
       
        OperationInfo op = serviceModel.getServiceInfo().getOperation("echo");
        Object[] response = client.invoke(op, new Object[] { "hello" });

        assertNotNull(response);
        assertEquals(1, response.length);

        String resString = (String) response[0];
View Full Code Here

        Transport transport = getTransportManager().getTransport(LocalTransport.BINDING_ID);
        Client client = new Client(transport, service, "xfire.local://Echo");
        client.setXFire(getXFire());
       
        OperationInfo op = service.getServiceInfo().getOperation("echo");
        Object[] response = client.invoke(op, new Object[] {"hello"});
        assertNotNull("response from client invoke is null", response);
        assertEquals("unexpected array size in invoke response", 1, response.length);
       
        String resString = (String) response[0];
        assertEquals("unexpected response string", "hello", resString);
View Full Code Here

        Transport transport = getTransportManager().getTransport(LocalTransport.BINDING_ID);
        Client client = new Client(transport, service, "xfire.log://Echo");
        client.setXFire(getXFire());

        OperationInfo op = service.getServiceInfo().getOperation("echo");
        Object[] response = client.invoke(op, new Object[] { null });
        assertNotNull("response from client invoke is null", response);
        assertEquals("unexpected array size in invoke response", 1, response.length);
       
        assertNull(response[0]);
    }
View Full Code Here

                Attachment att = atts.getPart("test.jpg");
                assertNotNull(att);
            }
        });

        client.invoke("echo", new Object[] { new Element("hi") });
    }

    public WebRequest getRequestMessage()
            throws Exception
    {
View Full Code Here

//        HttpClientParams params = new HttpClientParams();
//        params.setParameter("http.protocol.version", HttpVersion.HTTP_1_1);
//        client.setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS, params);
//    
        OperationInfo op = service.getServiceInfo().getOperation("echo");
        Object[] response = client.invoke(op, new Object[] {root});
        assertNotNull(response);
        assertEquals(1, response.length);
       
        Element e = (Element) response[0];
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.